diff options
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -471,6 +471,10 @@ static int Parser_get_unit(char **parameter, char **units) /* this function takes a parameter like "1e+6 ms" and breaks it into parameter="1e+6" and
units="ms" */
+ if (*parameter == NULL) {
+ *parameter = g_strdup ("");
+ }
+
g_assert (*units == NULL);
gchar *end_ptr;
@@ -647,9 +651,7 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer int error_num=OK;
- if (parameter_found) {
- units_found = Parser_get_unit(¶meter,&units);
- }
+ units_found = Parser_get_unit(¶meter,&units);
if (!error_num) {
command_type=(is_query<<2) | (parameter_found?2:0) | units_found;
|