test: make one error output test more robust.

Since notmuch_database_status_string can return NULL, passing it
directly to fputs is not a good idea.
This commit is contained in:
David Bremner 2015-03-29 09:39:46 +02:00
parent 6a99505625
commit 703c8f9511

View file

@ -126,9 +126,10 @@ int main (int argc, char** argv)
fprintf (stderr, "error opening database: %d\n", stat); fprintf (stderr, "error opening database: %d\n", stat);
} }
stat = notmuch_database_add_message (db, "/nonexistent", NULL); stat = notmuch_database_add_message (db, "/nonexistent", NULL);
if (stat) if (stat) {
fputs (notmuch_database_status_string (db), stderr); char *status_string = notmuch_database_status_string (db);
if (status_string) fputs (status_string, stderr);
}
} }
EOF EOF
cat <<'EOF' >EXPECTED cat <<'EOF' >EXPECTED