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; uuid[i]; ++i) {
if ( (uuid[i] == '\r') || (uuid[i] == '\n') ) {
uuid[i] = 0;
+ break;
}
}
lprintf(9, "UUID of note is: %s\n", uuid);
- if (strlen(uuid) > 0) {
+ if (!IsEmptyStr(uuid)) {
if (msg->cm_fields['E'] != NULL) {
free(msg->cm_fields['E']);