More string cleanups

FossilOrigin-Name: a401a49dd9b3759c48509aa50fa13dab309bf09462a137f4ecbf3c98dce9d9e4
This commit is contained in:
Jonathan Schleifer 2025-03-04 01:13:36 +00:00
parent 0e59beaf43
commit db3bb84a6a
12 changed files with 52 additions and 44 deletions

View file

@ -262,11 +262,11 @@ load_world(char *mname) // still supports all map formats that have existed
gzread(f, &hdr, sizeof(header) - sizeof(int) * 16);
endianswap(&hdr.version, sizeof(int), 4);
if (strncmp(hdr.head, "CUBE", 4) != 0)
fatal("while reading map: header malformatted");
fatal(@"while reading map: header malformatted");
if (hdr.version > MAPVERSION)
fatal("this map requires a newer version of cube");
fatal(@"this map requires a newer version of cube");
if (sfactor < SMALLEST_FACTOR || sfactor > LARGEST_FACTOR)
fatal("illegal map size");
fatal(@"illegal map size");
if (hdr.version >= 4) {
gzread(f, &hdr.waterlevel, sizeof(int) * 16);
endianswap(&hdr.waterlevel, sizeof(int), 16);
@ -329,8 +329,9 @@ load_world(char *mname) // still supports all map formats that have existed
}
default: {
if (type < 0 || type >= MAXTYPE) {
sprintf_sd(t)("%d @ %d", type, k);
fatal("while reading map: type out of range: ",
OFString *t = [OFString
stringWithFormat:@"%d @ %d", type, k];
fatal(@"while reading map: type out of range: ",
t);
}
s->type = type;