diff options
author | Albert Astals Cid <aacid@kde.org> | 2016-09-05 16:09:34 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2016-09-05 16:09:34 +0200 |
commit | 7024b3c97df1815a4f1c9f677dc05dcf5ee72c3d (patch) | |
tree | ca7a73e62b902e491427d5aaea58212e00d92ad4 | |
parent | a902f5983e6802c9346569fcc599cf5f5042bd8d (diff) |
No need to do a memcpy of an empty string
Saves some warnings about memcpy of null strings on some broken documents
-rw-r--r-- | goo/GooString.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/goo/GooString.cc b/goo/GooString.cc index de9c93c9..fb68e27b 100644 --- a/goo/GooString.cc +++ b/goo/GooString.cc @@ -163,7 +163,7 @@ void inline GooString::resize(int newLength) { // assert(s != s1) the roundedSize condition ensures this if (newLength < length) { memcpy(s1, s, newLength); - } else { + } else if (length > 0) { memcpy(s1, s, length); } if (s != sStatic) |