summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2013-07-24 10:29:30 -0700
committerDavid Schleef <ds@schleef.org>2013-07-24 10:30:09 -0700
commitf599019a990725349c9e3cbeb99b69c00a9d0c42 (patch)
tree525ca01b7912bfdc60fdfe35e9abae5f669814ce /gst
parentd55893fb962af53729f1053070a200c325611d0b (diff)
info: parse debug levels > 9
Diffstat (limited to 'gst')
-rw-r--r--gst/gstinfo.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gst/gstinfo.c b/gst/gstinfo.c
index 0660ed73c..4419817b7 100644
--- a/gst/gstinfo.c
+++ b/gst/gstinfo.c
@@ -1717,9 +1717,15 @@ parse_debug_level (gchar * str, GstDebugLevel * level)
/* works in place */
g_strstrip (str);
- if (str[0] != '\0' && str[1] == '\0'
- && str[0] >= '0' && str[0] < '0' + GST_LEVEL_COUNT) {
- *level = (GstDebugLevel) (str[0] - '0');
+ if (g_ascii_isdigit (str[0])) {
+ unsigned long l;
+ char *endptr;
+ l = strtoul (str, &endptr, 10);
+ if (endptr > str && endptr[0] == 0) {
+ *level = (GstDebugLevel) l;
+ } else {
+ return FALSE;
+ }
} else if (strcmp (str, "ERROR") == 0) {
*level = GST_LEVEL_ERROR;
} else if (strncmp (str, "WARN", 4) == 0) {