From a613ff8a73585b55359e9b7128b4a30665b1f191 Mon Sep 17 00:00:00 2001 Author: Leon Bottou Date: Thu Jun 27 18:38:03 2019 -0400 --- libdjvu/GString.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdjvu/GString.cpp b/libdjvu/GString.cpp index 181c0b2..f71e6b3 100644 --- a/libdjvu/GString.cpp +++ b/libdjvu/GString.cpp @@ -1212,11 +1212,11 @@ GP GStringRep::getbuf(int n) const { GP retval; - if(n< 0) + if(n < 0) n=strlen(data); - if(n>0) + if(n >= 0) { - retval=blank(n); + retval=blank((n>0) ? n : 1); char *ndata=retval->data; strncpy(ndata,data,n); ndata[n]=0; -- 2.23.0