Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
packet: return zero for pktbuf_len() when pktbuf ptr is NULL
  • Loading branch information
perexg committed Jan 13, 2015
1 parent 4949382 commit 6f6f20e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/packet.h
Expand Up @@ -115,7 +115,7 @@ pktbuf_t *pktbuf_make(void *data, size_t size);

pktbuf_t *pktbuf_append(pktbuf_t *pb, const void *data, size_t size);

static inline size_t pktbuf_len(pktbuf_t *pb) { return pb->pb_size; }
static inline size_t pktbuf_len(pktbuf_t *pb) { return pb ? pb->pb_size : 0; }
static inline uint8_t *pktbuf_ptr(pktbuf_t *pb) { return pb->pb_data; }

#endif /* PACKET_H_ */

0 comments on commit 6f6f20e

Please sign in to comment.