Re: [AD] Proposal for small change in d_edit_proc() |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> Well, it will break old programs (although it seems likely that it will
> also "heal" a lot of code where the author assumed that character=byte).
I think the purpose of this field is to prevent buffer overruns in the first
place, the other function (to specify a maximum number of characters) is
somewhat secondary. But ok, this latter can be useful too.
This proc obviously lacks a third parameter, which would allow to specify
both contraints. What about the following semantics :
- if d1>=0, d1 specifies the maximum number of characters,
- if d1<0, -d1 specifies the maximum number of characters and dp2 points to
one byte past the end of the buffer pointed to by dp ?
--
Eric Botcazou
ebotcazou@xxxxxxxxxx