diff options
Diffstat (limited to 'src/timestamp.c')
-rw-r--r-- | src/timestamp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/timestamp.c b/src/timestamp.c index 1df252a..f3f7861 100644 --- a/src/timestamp.c +++ b/src/timestamp.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <stdio.h> | ||
1 | #include <string.h> | 2 | #include <string.h> |
2 | 3 | ||
3 | #include "timestamp.h" | 4 | #include "timestamp.h" |
@@ -46,7 +47,8 @@ int str2event(const char* str, cmd_t *id) | |||
46 | *id = event_table[i].id; | 47 | *id = event_table[i].id; |
47 | return 1; | 48 | return 1; |
48 | } | 49 | } |
49 | return 0; | 50 | /* try to parse it as a number */ |
51 | return sscanf(str, "%u", id); | ||
50 | } | 52 | } |
51 | 53 | ||
52 | const char* event2str(cmd_t id) | 54 | const char* event2str(cmd_t id) |