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 | a36a146573171c9f42ebf48febceb3599f7f8fdc (patch) | |
tree | c40b08fc7b75b8700490ea5fd20f698ad8ea9962 | |
parent | 378ec58bebdbc2ae7c7306fc25f358a58478ecf8 (diff) | |
download | samba-a36a146573171c9f42ebf48febceb3599f7f8fdc.tar.gz samba-a36a146573171c9f42ebf48febceb3599f7f8fdc.tar.bz2 samba-a36a146573171c9f42ebf48febceb3599f7f8fdc.zip |
added grow_size to prs structure
(This used to be commit d8c988694cbcd037c43480a623c2fbc37f2df7de)
-rw-r--r-- | source3/aparser/parser.c | 4 | ||||
-rw-r--r-- | source3/aparser/parser.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source3/aparser/parser.c b/source3/aparser/parser.c index a324f804f8..27605dcfec 100644 --- a/source3/aparser/parser.c +++ b/source3/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/source3/aparser/parser.h b/source3/aparser/parser.h index 843d0c7a11..353a879cb7 100644 --- a/source3/aparser/parser.h +++ b/source3/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; |