commit 8205159f8ca98f525d892c02eb7dadfdf6d446d4
parent 80cd4eaada3836fb94f55b82a6e2a70d8f83fdb3
Author: default <nobody@localhost>
Date: Sun, 16 Apr 2023 20:12:44 +0200
Replaced strcpy() with strncpy().
To shut up some compiler whining.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/data.c b/data.c
@@ -1017,7 +1017,7 @@ xs_list *timeline_top_level(snac *snac, xs_list *list)
while (xs_list_iter(&p, &v)) {
char line[256] = "";
- strcpy(line, v);
+ strncpy(line, v, sizeof(line));
for (;;) {
char line2[256];
@@ -1031,7 +1031,7 @@ xs_list *timeline_top_level(snac *snac, xs_list *list)
break;
/* it's here! try again with its own parent */
- strcpy(line, line2);
+ strncpy(line, line2, sizeof(line));
}
xs_set_add(&seen, line);
diff --git a/mastoapi.c b/mastoapi.c
@@ -1064,7 +1064,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
char pid[64];
/* build the [grand]parent list, moving up */
- strcpy(pid, id);
+ strncpy(pid, id, sizeof(pid));
while (object_parent(pid, pid, sizeof(pid))) {
xs *m2 = NULL;