X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Fstringbuf.c;h=67a50ece57b97c64f1de39dcb550eedc57d5b4ca;hb=5da552611b36dfd7add1c0674f2362275ceee2b7;hp=f5cfbbb374866a2d6e45499e0334420db600d4c0;hpb=44ab8b1fd0e0386b15fd9c54f366ba1977e693c2;p=citadel.git diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index f5cfbbb37..67a50ece5 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -271,6 +271,8 @@ void HFreeStrBuf (void *VFreeMe) */ long StrTol(const StrBuf *Buf) { + if (Buf == NULL) + return 0; if(Buf->BufUsed > 0) return atol(Buf->buf); else @@ -282,7 +284,9 @@ long StrTol(const StrBuf *Buf) */ int StrToi(const StrBuf *Buf) { - if(Buf->BufUsed > 0) + if (Buf == NULL) + return 0; + if (Buf->BufUsed > 0) return atoi(Buf->buf); else return 0;