diff options
author | David Robillard <d@drobilla.net> | 2010-09-30 08:37:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-09-30 08:37:37 +0000 |
commit | b344c5c8dc089e3ea73d5fce41e11ffc59e20516 (patch) | |
tree | 63bb9f057ae48d2e970f5fcf3f4e0d682979f233 /src/value.c | |
parent | e28bb1e764783870cf36fca5c6d5203aae248dce (diff) | |
download | lilv-b344c5c8dc089e3ea73d5fce41e11ffc59e20516.tar.gz lilv-b344c5c8dc089e3ea73d5fce41e11ffc59e20516.tar.bz2 lilv-b344c5c8dc089e3ea73d5fce41e11ffc59e20516.zip |
Style.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2621 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/value.c')
-rw-r--r-- | src/value.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/value.c b/src/value.c index ef9f7ff..f4c48df 100644 --- a/src/value.c +++ b/src/value.c @@ -170,7 +170,7 @@ SLV2Value slv2_value_new_int(SLV2World world, int val) { char str[32]; - snprintf(str, 32, "%d", val); + snprintf(str, sizeof(str), "%d", val); SLV2Value ret = slv2_value_new(world, SLV2_VALUE_INT, str); ret->val.int_val = val; return ret; @@ -181,7 +181,7 @@ SLV2Value slv2_value_new_float(SLV2World world, float val) { char str[32]; - snprintf(str, 32, "%f", val); + snprintf(str, sizeof(str), "%f", val); SLV2Value ret = slv2_value_new(world, SLV2_VALUE_FLOAT, str); ret->val.float_val = val; return ret; @@ -259,7 +259,7 @@ slv2_value_get_turtle_token(SLV2Value value) switch (value->type) { case SLV2_VALUE_URI: len = strlen(value->str_val) + 3; - result = calloc(len, sizeof(char)); + result = calloc(len, 1); snprintf(result, len, "<%s>", value->str_val); break; case SLV2_VALUE_STRING: @@ -271,7 +271,7 @@ slv2_value_get_turtle_token(SLV2Value value) // FIXME: locale kludge, need a locale independent snprintf locale = strdup(setlocale(LC_NUMERIC, NULL)); len = 20; - result = calloc(len, sizeof(char)); + result = calloc(len, 1); setlocale(LC_NUMERIC, "POSIX"); snprintf(result, len, "%d", value->val.int_val); setlocale(LC_NUMERIC, locale); @@ -280,7 +280,7 @@ slv2_value_get_turtle_token(SLV2Value value) // FIXME: locale kludge, need a locale independent snprintf locale = strdup(setlocale(LC_NUMERIC, NULL)); len = 20; // FIXME: proper maximum value? - result = calloc(len, sizeof(char)); + result = calloc(len, 1); setlocale(LC_NUMERIC, "POSIX"); snprintf(result, len, "%f", value->val.float_val); setlocale(LC_NUMERIC, locale); |