Check for valid attachment array

SVN revision: 2093
This commit is contained in:
2008-04-04 20:03:44 +00:00
parent 4aed402f86
commit 013660c93e
+3 -3
View File
@@ -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("&nbsp;");
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("<td class=\"listatt\">&nbsp;");
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);