diff --git a/src/elogd.c b/src/elogd.c index 4d9885e9..2280c409 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -16442,7 +16442,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsputs(" "); for (i = 0; i < MAX_ATTACHMENTS; i++) - if (attachment[i][0]) { + if (attachment && attachment[i][0]) { strlcpy(str, attachment[i], sizeof(str)); str[13] = 0; sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14); @@ -16762,7 +16762,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsputs(" "); for (i = 0; i < MAX_ATTACHMENTS; i++) - if (attachment[i][0]) { + if (attachment && attachment[i][0]) { strlcpy(str, attachment[i], sizeof(str)); str[13] = 0; sprintf(ref, "../%s/%s/%s", lbs->name, str, attachment[i] + 14); @@ -16868,7 +16868,7 @@ void display_line(LOGBOOK * lbs, int message_id, int number, char *mode, int exp rsputs("