X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Flibpspp%2Fstr.c;h=c8497c34af4fbf1dd57ace97d18d1ad72e60116c;hb=9c8c1170e3b3cb59f9bf8fe6b27ecba7067b8cfa;hp=c72f19969ec8f1090f958e39c36a276f6b5b1f8f;hpb=8444d8d47de5e5f8d076b6f43f73c2c29494031e;p=pspp-builds.git diff --git a/src/libpspp/str.c b/src/libpspp/str.c index c72f1996..c8497c34 100644 --- a/src/libpspp/str.c +++ b/src/libpspp/str.c @@ -704,7 +704,7 @@ ds_vprintf (struct string *st, const char *format, va_list args_) #endif va_copy (args, args_); - avail = st->capacity - st->length + 1; + avail = st->string != NULL ? st->capacity - st->length + 1 : 0; needed = vsnprintf (st->string + st->length, avail, format, args); va_end (args);