From 875ad7ffda7deeb207dec1bf285b5ae4890e51a2 Mon Sep 17 00:00:00 2001 From: nifi Date: Mon, 26 Apr 2010 22:05:40 +0000 Subject: [PATCH] Fixed to not change the header if the header allocation fails --- core/net/rime/packetbuf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/net/rime/packetbuf.c b/core/net/rime/packetbuf.c index a47a09240..d8444fa28 100644 --- a/core/net/rime/packetbuf.c +++ b/core/net/rime/packetbuf.c @@ -33,7 +33,7 @@ * * This file is part of the Contiki operating system. * - * $Id: packetbuf.c,v 1.7 2010/03/29 21:53:04 adamdunkels Exp $ + * $Id: packetbuf.c,v 1.8 2010/04/26 22:05:40 nifi Exp $ */ /** @@ -168,11 +168,10 @@ packetbuf_copyto(void *to) int packetbuf_hdralloc(int size) { - if(hdrptr > size) { + if(hdrptr >= size) { hdrptr -= size; return 1; } - hdrptr = 0; return 0; } /*---------------------------------------------------------------------------*/