search for: parse_long

Displaying 4 results from an estimated 4 matches for "parse_long".

2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...ead of unsafe functions like L<sscanf(3)>, L<atoi(3)> and > +similar. > + > + int nbdkit_parse_int (const char *what, const char *str, int *r); > + int nbdkit_parse_unsigned (const char *what, > + const char *str, unsigned *r); > + int nbdkit_parse_long (const char *what, const char *str, long *r); > + int nbdkit_parse_unsigned_long (const char *what, > + const char *str, unsigned long *r); Do we really want to encourage the use of parse_long and parse_unsigned_long? Those differ between 32- and 64-bit platf...
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...and you should +use them instead of unsafe functions like L<sscanf(3)>, L<atoi(3)> and +similar. + + int nbdkit_parse_int (const char *what, const char *str, int *r); + int nbdkit_parse_unsigned (const char *what, + const char *str, unsigned *r); + int nbdkit_parse_long (const char *what, const char *str, long *r); + int nbdkit_parse_unsigned_long (const char *what, + const char *str, unsigned long *r); + int nbdkit_parse_int16_t (const char *what, + const char *str, int16_t *r); + int nbdkit_parse_uint16_t...
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On 9/23/19 12:52 PM, Richard W.M. Jones wrote: > On Mon, Sep 23, 2019 at 12:05:11PM -0500, Eric Blake wrote: >>> + int nbdkit_parse_long (const char *what, const char *str, long *r); >>> + int nbdkit_parse_unsigned_long (const char *what, >>> + const char *str, unsigned long *r); >> >> Do we really want to encourage the use of parse_long and >> parse_unsigned_long?...
2019 Sep 23
2
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
On Mon, Sep 23, 2019 at 12:05:11PM -0500, Eric Blake wrote: > > + int nbdkit_parse_long (const char *what, const char *str, long *r); > > + int nbdkit_parse_unsigned_long (const char *what, > > + const char *str, unsigned long *r); > > Do we really want to encourage the use of parse_long and > parse_unsigned_long? Those differ bet...