diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-15 09:56:30 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-15 09:56:30 +0000 |
commit | d8c988694cbcd037c43480a623c2fbc37f2df7de (patch) | |
tree | d996c2a90316fd412d4aadbb01be53eaba8e8235 /source/aparser | |
parent | ce3dd8db6d3cf6bfdbd695f6e32f60488c9073ae (diff) | |
download | samba-d8c988694cbcd037c43480a623c2fbc37f2df7de.tar.gz |
added grow_size to prs structure
Diffstat (limited to 'source/aparser')
-rw-r--r-- | source/aparser/parser.c | 4 | ||||
-rw-r--r-- | source/aparser/parser.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source/aparser/parser.c b/source/aparser/parser.c index a324f804f86..27605dcfec6 100644 --- a/source/aparser/parser.c +++ b/source/aparser/parser.c @@ -46,6 +46,8 @@ BOOL prs_grow(prs_struct *ps, uint32 extra_space) uint32 new_size; char *new_data; + ps->grow_size = MAX(ps->grow_size, ps->data_offset + extra_space); + if(ps->data_offset + extra_space <= ps->buffer_size) return True; @@ -267,7 +269,7 @@ void dump_data(int level,char *buf1,int len) ********************************************************************/ BOOL prs_pointer(char *desc, prs_struct *ps, int depth, void **p) { - uint32 v; + uint32 v = (*p) ? 1 : 0; if (!prs_uint32(desc, ps, depth, &v)) return False; *p = (void *) (v ? 1 : 0); return True; diff --git a/source/aparser/parser.h b/source/aparser/parser.h index 843d0c7a118..353a879cb72 100644 --- a/source/aparser/parser.h +++ b/source/aparser/parser.h @@ -48,6 +48,7 @@ typedef struct _prs_struct BOOL is_dynamic; /* Do we own this memory or not ? */ uint32 data_offset; /* Current working offset into data. */ uint32 buffer_size; /* Current size of the buffer. */ + uint32 grow_size; /* size requested via prs_grow() calls */ char *data_p; /* The buffer itself. */ } prs_struct; |