Files
@ r3478:523ece58cb16
Branch filter:
Location: cpp/openttd-patchpack/source/string.c - annotation
r3478:523ece58cb16
1.2 KiB
text/x-c
(svn r4323) -Regression: Clear the slot assignments of all vehicles heading twoards a road stop if that road stop gets removed
This issue was fixed in r2210 and reintroduced in r4259 when the multistop handling was overhauled.
This issue was fixed in r2210 and reintroduced in r4259 when the multistop handling was overhauled.
r2186:5ee653b1b5e1 r2186:5ee653b1b5e1 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r2234:6f59925a7314 r2234:6f59925a7314 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r1317:3783af524858 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2234:6f59925a7314 r2775:3e6efcedc84d r2775:3e6efcedc84d r2775:3e6efcedc84d r2775:3e6efcedc84d r2775:3e6efcedc84d r2775:3e6efcedc84d | /* $Id$ */
#include "stdafx.h"
#include "string.h"
#include <stdarg.h>
void ttd_strlcat(char *dst, const char *src, size_t size)
{
assert(size > 0);
for (; size > 0 && *dst != '\0'; --size, ++dst) {}
assert(size > 0);
while (--size > 0 && *src != '\0') *dst++ = *src++;
*dst = '\0';
}
void ttd_strlcpy(char *dst, const char *src, size_t size)
{
assert(size > 0);
while (--size > 0 && *src != '\0') *dst++ = *src++;
*dst = '\0';
}
char* strecat(char* dst, const char* src, const char* last)
{
assert(last == NULL || dst <= last);
for (; *dst != '\0'; ++dst)
if (dst == last) return dst;
for (; *src != '\0' && dst != last; ++dst, ++src) *dst = *src;
*dst = '\0';
return strecpy(dst, src, last);
}
char* strecpy(char* dst, const char* src, const char* last)
{
assert(last == NULL || dst <= last);
for (; *src != '\0' && dst != last; ++dst, ++src) *dst = *src;
*dst = '\0';
return dst;
}
char* CDECL str_fmt(const char* str, ...)
{
char buf[4096];
va_list va;
int len;
char* p;
va_start(va, str);
len = vsprintf(buf, str, va);
va_end(va);
p = malloc(len + 1);
if (p != NULL) memcpy(p, buf, len + 1);
return p;
}
void str_validate(char *str)
{
for (; *str != '\0'; str++)
if (!IsValidAsciiChar(*str)) *str = '?';
}
|