Skip to content
This repository was archived by the owner on Oct 29, 2021. It is now read-only.

Commit 6bb3507

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents ad87bbd + 151debf commit 6bb3507

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/snprintf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ static int dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c)
705705

706706
int xmpp_vsnprintf (char *str, size_t count, const char *fmt, va_list args)
707707
{
708-
if (str != NULL)
708+
if (str != NULL && count > 0)
709709
str[0] = 0;
710710
return dopr(str, count, fmt, args);
711711
}

src/stanza.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ static char *_escape_xml(xmpp_ctx_t * const ctx, char *text)
281281
}
282282

283283
/* small helper function */
284-
static inline void _render_update(int *written, const int length,
284+
static void _render_update(int *written, const int length,
285285
const int lastwrite,
286286
size_t *left, char **ptr)
287287
{
288288
*written += lastwrite;
289289

290-
if (*written > length) {
290+
if (*written >= length) {
291291
*left = 0;
292292
*ptr = NULL;
293293
} else {

0 commit comments

Comments
 (0)