projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca4f8ec
)
Fixed UI32_STRING_ALLOC formatting.
author
Pekka Riikonen
<priikone@silcnet.org>
Sun, 22 Apr 2007 18:23:16 +0000
(18:23 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Sun, 22 Apr 2007 18:23:16 +0000
(18:23 +0000)
lib/silcutil/silcbuffmt.c
patch
|
blob
|
history
diff --git
a/lib/silcutil/silcbuffmt.c
b/lib/silcutil/silcbuffmt.c
index 562af7d86501524808c3c596e11645fa77b412cc..abcc65f4df6da7352987983713c9a940fc938b06 100644
(file)
--- a/
lib/silcutil/silcbuffmt.c
+++ b/
lib/silcutil/silcbuffmt.c
@@
-116,10
+116,12
@@
int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap)
case SILC_PARAM_UI32_STRING_ALLOC:
{
unsigned char *x = va_arg(ap, unsigned char *);
- SilcUInt32 tmp_len = strlen(x);
- FORMAT_HAS_SPACE(stack, dst, tmp_len);
- silc_buffer_put(dst, x, tmp_len);
- silc_buffer_pull(dst, tmp_len);
+ SilcUInt32 tmp_len = x ? strlen(x) : 0;
+ if (x && tmp_len) {
+ FORMAT_HAS_SPACE(stack, dst, tmp_len);
+ silc_buffer_put(dst, x, tmp_len);
+ silc_buffer_pull(dst, tmp_len);
+ }
break;
}
case SILC_PARAM_UI8_NSTRING: