mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-09-06 11:59:40 +02:00
cast the return values of malloc() function calls
This commit is contained in:
+2
-2
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user