Fixed to not change the header if the header allocation fails
This commit is contained in:
parent
b26f45a35b
commit
875ad7ffda
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in a new issue