From 5d46b03f09ae0b569418089f0d6efdcfb5414efe Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Sat, 23 Oct 2010 23:14:59 +0200 Subject: [PATCH] add content-type only if valid --- examples/client.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/client.c b/examples/client.c index e9c0dfe7..d0730089 100644 --- a/examples/client.c +++ b/examples/client.c @@ -450,9 +450,11 @@ cmdline_content_type(char *arg, unsigned short key) { q = p+1; } - node = new_option_node(key, valcnt, value); - if (node) - coap_insert( &optlist, node, order_opts ); + if (valcnt) { + node = new_option_node(key, valcnt, value); + if (node) + coap_insert( &optlist, node, order_opts ); + } } void