sync with private git
authorJunghwan Song <jump.song@samsung.com>
Fri, 24 Aug 2012 14:05:50 +0000 (23:05 +0900)
committerJunghwan Song <jump.song@samsung.com>
Fri, 24 Aug 2012 14:05:50 +0000 (23:05 +0900)
packaging/tel-plugin-atmodem.spec
src/s_common.c

index e6ffdb6..1797549 100644 (file)
@@ -1,7 +1,7 @@
 #sbs-git:slp/pkgs/t/tel-plugin-atmodem
 Name: tel-plugin-atmodem
 Summary: Telephony AT Modem library
-Version: 0.1.15
+Version: 0.1.17
 Release:    1
 Group:      System/Libraries
 License:    Apache
index 17037d4..290d20e 100644 (file)
@@ -177,24 +177,23 @@ unsigned char util_hexCharToInt(char c)
 char * util_hexStringToBytes(char * s)
 {
     char * ret;
-    int     i;
-    int         sz;
+       int i;
+       int sz;
 
-    if(s == NULL)
-        return NULL;
+       if (s == NULL)
+               return NULL;
 
-        sz = strlen(s);
+       sz = strlen(s);
 
-    ret = malloc(sz /2);
+       ret = calloc((sz/2)+1, 1);
 
-    dbg("Convert String to Binary!!");
+       dbg("Convert String to Binary!!");
 
-    for(i = 0; i < sz; i += 2)
-    {
-        ret[i/2] = (char)((util_hexCharToInt(s[i]) << 4) | util_hexCharToInt(s[i + 1]));
-        dbg("[%02x]", ret[i/2]);
-    }
+       for (i = 0; i < sz; i += 2) {
+               ret[i / 2] = (char) ((util_hexCharToInt(s[i]) << 4) | util_hexCharToInt(s[i + 1]));
+               dbg("[%02x]", ret[i/2]);
+       }
 
-    return ret;
+       return ret;
 }