Mercurial > code
comparison buffer.h @ 21:ae4128d16c92
Improve security and FIXED size buffer
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 09 Sep 2011 17:32:53 +0200 |
parents | 9ee89108528b |
children | 5252fa9b5cb1 |
comparison
equal
deleted
inserted
replaced
20:a7ff7f59c7f6 | 21:ae4128d16c92 |
---|---|
25 | 25 |
26 struct buffer { | 26 struct buffer { |
27 char *data; /* string buffer */ | 27 char *data; /* string buffer */ |
28 size_t length; /* string's length */ | 28 size_t length; /* string's length */ |
29 | 29 |
30 #define BUFFER_AUTO 0x00000000 | 30 #define BUFFER_FIXED 0x00000000 |
31 #define BUFFER_FIXED 0x00000001 | 31 #define BUFFER_AUTO 0x00000001 |
32 int flags; /* buffer's flags (default AUTO) */ | 32 int flags; /* buffer's flags (default AUTO) */ |
33 | 33 |
34 /* Private should not be modified by user */ | 34 /* Private should not be modified by user */ |
35 size_t size; /* current size */ | 35 size_t size; /* current size */ |
36 size_t bsize; /* block size */ | 36 size_t bsize; /* block size */ |