cast the return values of malloc() function calls

This commit is contained in:
rlar
2010-07-01 19:52:23 +00:00
parent 0dbebc870c
commit 3369d860b4
56 changed files with 224 additions and 163 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ copy(const char *str)
{
char *p;
if ((p = tmalloc(strlen(str) + 1)))
if ((p = (char*) tmalloc(strlen(str) + 1)))
(void) strcpy(p, str);
return(p);
}
@@ -39,7 +39,7 @@ copy_substring(const char *str, const char *end)
int n = end - str;
char *p;
if ((p = tmalloc(n + 1))) {
if ((p = (char*) tmalloc(n + 1))) {
(void) strncpy(p, str, n);
p[n] = '\0';
}