X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fsysdep.c;h=1413675ea9d07b4bf46745a7249763c7c2eb3fb6;hp=1ce836558162ea1e661e56839048bfacad7a848f;hb=a2a06e5d6767d0e45eeccf4032153764e8a5520f;hpb=5a8bd30ddb83d2588f617df6c2024ddd20345e2b diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 1ce836558..1413675ea 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -704,7 +704,7 @@ int client_getln(char *buf, int bufsize) /* Strip the trailing LF, and the trailing CR if present. */ buf[i] = 0; - while ( (strlen(buf) > 0) && ((buf[strlen(buf)-1]==10) || (buf[strlen(buf)-1] == 13)) ) { + while ( (!IsEmptyStr(buf)) && ((buf[strlen(buf)-1]==10) || (buf[strlen(buf)-1] == 13)) ) { buf[strlen(buf)-1] = 0; } if (retval < 0) safestrncpy(buf, "000", bufsize);