cmdline: check size of result buffer to avoid overflow
[libcmdline.git] / src / lib / cmdline_parse_num.h
index 45db43a..1b8c79d 100644 (file)
@@ -68,11 +68,13 @@ enum cmdline_numtype {
        UINT8 = 0,
        UINT16,
        UINT32,
+       UINT64,
        INT8,
        INT16,
        INT32,
+       INT64
 #ifndef NO_PARSE_FLOAT
-       FLOAT,
+       ,FLOAT
 #endif
 };
 
@@ -89,7 +91,7 @@ typedef struct cmdline_token_num cmdline_parse_token_num_t;
 extern struct cmdline_token_ops cmdline_token_num_ops;
 
 int cmdline_parse_num(cmdline_parse_token_hdr_t *tk,
-                     const char *srcbuf, void *res);
+                     const char *srcbuf, void *res, unsigned ressize);
 int cmdline_get_help_num(cmdline_parse_token_hdr_t *tk,
                         char *dstbuf, unsigned int size);