mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
muri: use strlcpy instead of strcpy
FossilOrigin-Name: 21eb6766abd875429b9987d2c46d474128f6ab6dab4222d89da9e6e9f1367512
This commit is contained in:
parent
37066306b3
commit
5781652fdf
2 changed files with 3 additions and 3 deletions
|
@ -128,7 +128,7 @@ table. It also terminates the build if the label already exists.
|
|||
~~~
|
||||
void add_label(char *name, int32_t slice) {
|
||||
if (lookup(name) == -1) {
|
||||
strcpy(Labels[np], name);
|
||||
strlcpy(Labels[np], name, STRING_LEN);
|
||||
Pointers[np] = slice;
|
||||
np++;
|
||||
} else {
|
||||
|
|
|
@ -33,7 +33,7 @@ int32_t lookup(char *name) {
|
|||
}
|
||||
void add_label(char *name, int32_t slice) {
|
||||
if (lookup(name) == -1) {
|
||||
strcpy(Labels[np], name);
|
||||
strlcpy(Labels[np], name, STRING_LEN);
|
||||
Pointers[np] = slice;
|
||||
np++;
|
||||
} else {
|
||||
|
@ -168,6 +168,6 @@ int main(int argc, char **argv) {
|
|||
printf("Wrote %d cells to ngaImage\n", here);
|
||||
}
|
||||
else
|
||||
printf("muri\n(c) 2017-2018 charles childers\n\n%s filename\n", argv[0]);
|
||||
printf("muri\n(c) 2017-2019 charles childers\n\n%s filename\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue