diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-12-11 00:10:41 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-12-11 00:10:41 +0000 |
commit | 73eabece3365c1bb47bf6b009682219c4492fda5 (patch) | |
tree | 907b66e2fe29705a512e5f3a240210590b8fe9ba /polyp/modargs.c | |
parent | 5be9641ffe18c482294c99345306c382ba4cf750 (diff) |
* add first part of zeroconf publisher
* bump version to 0.7.1.
* improve logging subsystem (introducing log levels)
* remove verbose flag on cli
* add new API pa_sample_format_to_string()
* replace strtol() by usages of pa_atou() and pa_atoi()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@317 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/modargs.c')
-rw-r--r-- | polyp/modargs.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/polyp/modargs.c b/polyp/modargs.c index 406f610f..9437d839 100644 --- a/polyp/modargs.c +++ b/polyp/modargs.c @@ -190,41 +190,27 @@ const char *pa_modargs_get_value(struct pa_modargs *ma, const char *key, const c int pa_modargs_get_value_u32(struct pa_modargs *ma, const char *key, uint32_t *value) { const char *v; - char *e; - unsigned long l; assert(ma && key && value); if (!(v = pa_modargs_get_value(ma, key, NULL))) return 0; - if (!*v) - return -1; - - l = strtoul(v, &e, 0); - if (*e) + if (pa_atou(v, value) < 0) return -1; - *value = (uint32_t) l; return 0; } int pa_modargs_get_value_s32(struct pa_modargs *ma, const char *key, int32_t *value) { const char *v; - char *e; - signed long l; assert(ma && key && value); if (!(v = pa_modargs_get_value(ma, key, NULL))) return 0; - if (!*v) + if (pa_atoi(v, value) < 0) return -1; - - l = strtol(v, &e, 0); - if (*e) - return -1; - - *value = (int32_t) l; + return 0; } |