diff options
author | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2014-12-06 02:14:20 -0300 |
---|---|---|
committer | Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com> | 2014-12-06 02:24:53 -0300 |
commit | ac896f0cd1b1e71f1f62da451dc96abef80f3c71 (patch) | |
tree | 0a5a138f46abc61e1bbd7aa48f34c704550516a4 /ffserver_config.c | |
parent | da95fe4ef81c120de0bf566c1881bec89f8f086f (diff) | |
download | ffmpeg-ac896f0cd1b1e71f1f62da451dc96abef80f3c71.tar.gz |
ffserver_config: reflow _get_arg()
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Diffstat (limited to 'ffserver_config.c')
-rw-r--r-- | ffserver_config.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/ffserver_config.c b/ffserver_config.c index 1e79a5d920..9f9655ef5e 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -84,28 +84,24 @@ void ffserver_get_arg(char *buf, int buf_size, const char **pp) { const char *p; char *q; - int quote; + int quote = 0; p = *pp; - while (av_isspace(*p)) p++; q = buf; - quote = 0; + + while (av_isspace(*p)) p++; + if (*p == '\"' || *p == '\'') quote = *p++; - for(;;) { - if (quote) { - if (*p == quote) - break; - } else { - if (av_isspace(*p)) - break; - } - if (*p == '\0') + + while (*p != '\0') { + if (quote && *p == quote || !quote && av_isspace(*p)) break; if ((q - buf) < buf_size - 1) *q++ = *p; p++; } + *q = '\0'; if (quote && *p == quote) p++; |