projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
337c51c
)
elm_font: correct argument order for calloc()
author
Stefan Schmidt
<stefan@osg.samsung.com>
Mon, 30 Nov 2015 20:58:39 +0000
(21:58 +0100)
committer
Stefan Schmidt
<stefan@osg.samsung.com>
Mon, 30 Nov 2015 20:58:39 +0000
(21:58 +0100)
calloc() expects count first and the actual size to allocate as second
argument. Say Thank You to smatch for finding this issues for us.
legacy/elementary/src/lib/elm_font.c
patch
|
blob
|
history
diff --git
a/legacy/elementary/src/lib/elm_font.c
b/legacy/elementary/src/lib/elm_font.c
index
1f34681
..
797ecad
100644
(file)
--- a/
legacy/elementary/src/lib/elm_font.c
+++ b/
legacy/elementary/src/lib/elm_font.c
@@
-24,7
+24,7
@@
_elm_font_properties_get(Eina_Hash **font_hash,
/* get font name */
len = token - font;
- name = calloc(
sizeof(char), len + 1
);
+ name = calloc(
len + 1, sizeof(char)
);
if (!name) return NULL;
strncpy(name, font, len);
@@
-68,7
+68,7
@@
_elm_font_properties_get(Eina_Hash **font_hash,
char *style_old = style;
len = substyle - style;
- style = calloc(
sizeof(char), len + 1
);
+ style = calloc(
len + 1, sizeof(char)
);
if (style)
{
strncpy(style, style_old, len);