mirror of https://github.com/OpenTTD/OpenTTD
(svn r6886) -Be anal for the time being about string-wannabe-buffer-overflows
parent
62181fe6e7
commit
7af4492c3b
2
string.c
2
string.c
|
@ -42,7 +42,7 @@ char* strecpy(char* dst, const char* src, const char* last)
|
||||||
assert(dst <= last);
|
assert(dst <= last);
|
||||||
for (; *src != '\0' && dst != last; ++dst, ++src) *dst = *src;
|
for (; *src != '\0' && dst != last; ++dst, ++src) *dst = *src;
|
||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
#if 0
|
#if 1
|
||||||
if (dst == last && *src != '\0') {
|
if (dst == last && *src != '\0') {
|
||||||
error("String too long for destination buffer");
|
error("String too long for destination buffer");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue