diff options
Diffstat (limited to 'lib/ofp-actions.c')
-rw-r--r-- | lib/ofp-actions.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index a0b70a89d..c13f97b5c 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -3202,16 +3202,21 @@ set_field_split_str(char *arg, char **key, char **value, char **delim) { char *value_end; + *key = NULL; *value = arg; - value_end = strstr(arg, "->"); - *key = value_end + strlen("->"); if (delim) { - *delim = value_end; + *delim = NULL; } + value_end = strstr(arg, "->"); if (!value_end) { return xasprintf("%s: missing `->'", arg); } + + *key = value_end + strlen("->"); + if (delim) { + *delim = value_end; + } if (strlen(value_end) <= strlen("->")) { return xasprintf("%s: missing field name following `->'", arg); } |