examples ecore_buffer: correct argument order for calloc()
authorStefan Schmidt <stefan@osg.samsung.com>
Mon, 30 Nov 2015 15:22:02 +0000 (16:22 +0100)
committerStefan Schmidt <stefan@osg.samsung.com>
Mon, 30 Nov 2015 15:31:58 +0000 (16:31 +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.

src/examples/ecore/ecore_buffer_consumer_example.c
src/examples/ecore/ecore_buffer_provider_example.c

index 1363aa0..96f18a8 100644 (file)
@@ -144,7 +144,7 @@ main(void)
         return -1;
      }
 
-   cd = (Consumer_Data *)calloc(sizeof(Consumer_Data), 1);
+   cd = (Consumer_Data *)calloc(1, sizeof(Consumer_Data));
 
    if (!cd || !(cd->consumer = ecore_buffer_consumer_new(name, queue_size, WIDTH, HEIGHT)))
      {
index 5d1d5b0..7b1d433 100644 (file)
@@ -244,7 +244,7 @@ main(void)
         return -1;
      }
 
-   pd = (Provider_Data *)calloc(sizeof(Provider_Data), 1);
+   pd = (Provider_Data *)calloc(1, sizeof(Provider_Data));
 
    if (!pd || !(pd->provider = ecore_buffer_provider_new(name)))
      {