if (c == '\0') goto gen_case;
buf[i] = c;
}
- buf[i] = '\0';
+
result = GC_MALLOC_ATOMIC(len+1);
if (result == 0) OUT_OF_MEMORY;
- strcpy(result, buf);
+ memcpy(result, buf, len);
result[len] = '\0';
return((CORD) result);
}
}
*p++ = c;
}
- *p = '\0';
result = GC_MALLOC_ATOMIC(n+1);
if (result == 0) OUT_OF_MEMORY;
- strcpy(result, buf);
+ memcpy(result, buf, n);
+ result[n] = '\0';
return(result);
}
}
# endif
return NULL;
}
-# ifndef MSWINCE
- strcpy(copy, str);
-# else
- /* strcpy() is deprecated in WinCE */
- memcpy(copy, str, lb);
-# endif
+ BCOPY(str, copy, lb);
return copy;
}
# endif
return NULL;
}
-# ifndef MSWINCE
- strcpy(copy, s);
-# else
- /* strcpy() is deprecated in WinCE */
- memcpy(copy, s, lb);
-# endif
+ BCOPY(s, copy, lb);
return copy;
}
if (len > 4 && path[len - 4] == (TCHAR)'.') {
len -= 4; /* strip executable file extension */
}
- memcpy(&path[len], TEXT(".gc.env"), sizeof(TEXT(".gc.env")));
+ BCOPY(TEXT(".gc.env"), &path[len], sizeof(TEXT(".gc.env")));
hFile = CreateFile(path, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL /* lpSecurityAttributes */, OPEN_EXISTING,
if (len > 4 && pathBuf[len - 4] == (TCHAR)'.') {
len -= 4; /* strip executable file extension */
}
- /* strcat/wcscat() are deprecated on WinCE, so use memcpy() */
- memcpy(&pathBuf[len], TEXT("." GC_LOG_STD_NAME),
- sizeof(TEXT("." GC_LOG_STD_NAME)));
+ BCOPY(TEXT("." GC_LOG_STD_NAME), &pathBuf[len],
+ sizeof(TEXT("." GC_LOG_STD_NAME)));
# endif
}
(unsigned long)info[i].ci_pc);
old_preload = GETENV("LD_PRELOAD");
if (0 != old_preload) {
- if (strlen (old_preload) >= PRELOAD_SZ) {
+ size_t old_len = strlen(old_preload);
+ if (old_len >= PRELOAD_SZ) {
will_fail = TRUE;
goto out;
}
- strcpy (preload_buf, old_preload);
+ BCOPY(old_preload, preload_buf, old_len + 1);
unsetenv ("LD_PRELOAD");
}
pipe = popen(cmd_buf, "r");
WARN("Failed to reset LD_PRELOAD\n", 0);
}
if (pipe == NULL
- || (result_len = fread(result_buf, 1, RESULT_SZ - 1, pipe))
- == 0) {
+ || (result_len = fread(result_buf, 1,
+ RESULT_SZ - 1, pipe)) == 0) {
if (pipe != NULL) pclose(pipe);
will_fail = TRUE;
goto out;