summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-11-30 21:58:39 +0100
committerStefan Schmidt <stefan@osg.samsung.com>2015-11-30 21:58:39 +0100
commit63677ba6849debc02613f205d8033d72e88cd120 (patch)
treed5eb37ea6aa5694ed82bdf5f47d01b8149abcca7
parent37536054042df43b1756a98231ca5253c799f057 (diff)
elm_font: correct argument order for calloc()
calloc() expects count first and the actual size to allocate as second argument. Say Thank You to smatch for finding this issues for us.
-rw-r--r--src/lib/elm_font.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/elm_font.c b/src/lib/elm_font.c
index 1f34681a8..797ecad02 100644
--- a/src/lib/elm_font.c
+++ b/src/lib/elm_font.c
@@ -24,7 +24,7 @@ _elm_font_properties_get(Eina_Hash **font_hash,
24 24
25 /* get font name */ 25 /* get font name */
26 len = token - font; 26 len = token - font;
27 name = calloc(sizeof(char), len + 1); 27 name = calloc(len + 1, sizeof(char));
28 if (!name) return NULL; 28 if (!name) return NULL;
29 strncpy(name, font, len); 29 strncpy(name, font, len);
30 30
@@ -68,7 +68,7 @@ _elm_font_properties_get(Eina_Hash **font_hash,
68 char *style_old = style; 68 char *style_old = style;
69 69
70 len = substyle - style; 70 len = substyle - style;
71 style = calloc(sizeof(char), len + 1); 71 style = calloc(len + 1, sizeof(char));
72 if (style) 72 if (style)
73 { 73 {
74 strncpy(style, style_old, len); 74 strncpy(style, style_old, len);