projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix off by one when cutting utf8-strings
[citadel.git]
/
libcitadel
/
lib
/
stringbuf.c
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index cf786ab5f10956a3dc94de6265f120fcaf41eac1..12fd259e4582ef93d9da48158582d4a0ca0bca40 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-4142,11
+4142,11
@@
long StrBuf_Utf8StrCut(StrBuf *Buf, int maxlen)
n++;
aptr++;
}
- if (n > maxlen) {
+ if (n >
=
maxlen) {
*aptr = '\0';
Buf->BufUsed = aptr - Buf->buf;
return Buf->BufUsed;
- }
+ }
}
return Buf->BufUsed;