From 09f5b6d2f5744fde70687b209d51448ea7f697d6 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Thu, 3 Jul 2008 09:51:21 +0000 Subject: [PATCH] Send one extra byte to ensure that the terminating zero is included --- apps/shell/shell-rime-netcmd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/shell/shell-rime-netcmd.c b/apps/shell/shell-rime-netcmd.c index e587026bc..211a5f12e 100644 --- a/apps/shell/shell-rime-netcmd.c +++ b/apps/shell/shell-rime-netcmd.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell-rime-netcmd.c,v 1.1 2008/02/05 20:35:21 adamdunkels Exp $ + * $Id: shell-rime-netcmd.c,v 1.2 2008/07/03 09:51:21 adamdunkels Exp $ */ /** @@ -53,8 +53,6 @@ #include "net/rime/timesynch.h" -#define WITH_DEBUG_COMMANDS 0 - #if NETSIM #include "ether.h" #endif /* NETSIM */ @@ -118,7 +116,7 @@ PROCESS_THREAD(shell_netcmd_process, ev, data) rimebuf_clear(); msg = rimebuf_dataptr(); - rimebuf_set_datalen(len + 1); + rimebuf_set_datalen(len + 2); strcpy(msg->netcmd, data); /* printf("netcmd sending '%s'\n", msg->netcmd);*/ trickle_send(&trickle); @@ -141,7 +139,7 @@ recv_trickle(struct trickle_conn *c) is should be already). */ msg->netcmd[rimebuf_datalen() - 2] = 0; - + /* Start the server process with the incoming command. */ process_start(&shell_netcmd_server_process, msg->netcmd); }