comparison src/libmlk-rpg/rpg/map-file.c @ 420:7d2ebc334c8c

misc: rename core to util
author David Demelier <markand@malikania.fr>
date Wed, 12 Oct 2022 15:26:12 +0200
parents d74f53299252
children 26d23999a54b
comparison
equal deleted inserted replaced
419:1b4e61bdb9ab 420:7d2ebc334c8c
22 #include <stddef.h> 22 #include <stddef.h>
23 #include <stdio.h> 23 #include <stdio.h>
24 #include <stdlib.h> 24 #include <stdlib.h>
25 #include <string.h> 25 #include <string.h>
26 26
27 #include <port/port.h> 27 #include <util/util.h>
28 28
29 #include <core/alloc.h> 29 #include <core/alloc.h>
30 #include <core/error.h> 30 #include <core/error.h>
31 #include <core/image.h> 31 #include <core/image.h>
32 #include <core/trace.h> 32 #include <core/trace.h>
222 parse(struct context *ctx, const char *path) 222 parse(struct context *ctx, const char *path)
223 { 223 {
224 char line[1024]; 224 char line[1024];
225 char basedir[PATH_MAX]; 225 char basedir[PATH_MAX];
226 226
227 port_strlcpy(basedir, path, sizeof (basedir)); 227 util_strlcpy(basedir, path, sizeof (basedir));
228 port_strlcpy(ctx->basedir, port_dirname(basedir), sizeof (ctx->basedir)); 228 util_strlcpy(ctx->basedir, util_dirname(basedir), sizeof (ctx->basedir));
229 229
230 while (fgets(line, sizeof (line), ctx->fp)) { 230 while (fgets(line, sizeof (line), ctx->fp)) {
231 /* Remove \n if any */ 231 /* Remove \n if any */
232 line[strcspn(line, "\r\n")] = '\0'; 232 line[strcspn(line, "\r\n")] = '\0';
233 233