* strlen holy war: loops. in loops it's very evil. the easy ones go away now.
[citadel.git] / citadel / modules / notes / serv_notes.c
index 374cb57eba25b7cc5a25005011898b8706bfe237..242fa3e5a358cf794e73247a321a7e8cff2194de 100644 (file)
@@ -76,9 +76,10 @@ int serv_notes_beforesave(struct CtdlMessage *msg)
        while (--a > 0) {
                if (!strncasecmp(p, "X-KOrg-Note-Id: ", 16)) {  /* Found it */
                        safestrncpy(uuid, p + 16, sizeof(uuid));
-                       for (i = 0; i<strlen(uuid); ++i) {
+                       for (i = 0; !IsEmptyStr(&uuid[i]); ++i) {
                                if ( (uuid[i] == '\r') || (uuid[i] == '\n') ) {
                                        uuid[i] = 0;
+                                       break;
                                }
                        }