From: Enlightenment S. <no-...@en...> - 2010-12-04 04:23:30
|
Log: null strings are not acceptable here Author: discomfitor Date: 2010-12-03 20:23:21 -0800 (Fri, 03 Dec 2010) New Revision: 55254 Trac: http://trac.enlightenment.org/e/changeset/55254 Modified: trunk/PROTO/azy/src/lib/azy_utils.c Modified: trunk/PROTO/azy/src/lib/azy_utils.c =================================================================== --- trunk/PROTO/azy/src/lib/azy_utils.c 2010-12-04 04:18:35 UTC (rev 55253) +++ trunk/PROTO/azy/src/lib/azy_utils.c 2010-12-04 04:23:21 UTC (rev 55254) @@ -30,7 +30,7 @@ char *ret = NULL; int retlen[2]; - if (len < 1) return NULL; + if ((len < 1) || (!string)) return NULL; if (!(ret = malloc(sizeof(char) * ((((len + 2) - ((int)(len + 2) % 3)) / 3) * 4) + 4))) return NULL; @@ -58,7 +58,7 @@ char *ret = NULL; int retlen; - if (len < 1) return NULL; + if ((len < 1) || (!string)) return NULL; if (!(ret = malloc(sizeof(char) * (int)((double)len / (double)(4 / 3)) + 1))) return NULL; @@ -99,7 +99,7 @@ /** * @brief Read a UUID from /proc/sys/kernel/random/uuid and stringshare it - * @return The stringshared uuid + * @return The stringshared uuid or #NULL on error * This function is used to return a stringshared random UUID. UUIDS are * Universally Unique IDentifiers, strings of 36 characters such as: * 550e8400-e29b-41d4-a716-446655440000 |