diff options
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/login.c | 2 | ||||
-rw-r--r-- | toys/other/losetup.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/toys/other/login.c b/toys/other/login.c index 91523d43..0d6d3640 100644 --- a/toys/other/login.c +++ b/toys/other/login.c @@ -165,7 +165,7 @@ void login_main(void) tcflush(0, TCIFLUSH); username[sizeof(username)-1] = 0; - if (*toys.optargs) strncpy(username, *toys.optargs, sizeof(username)-1); + if (*toys.optargs) xstrncpy(username, *toys.optargs, sizeof(username)); else { read_user(username, sizeof(username)); if (!*username) continue; diff --git a/toys/other/losetup.c b/toys/other/losetup.c index e3094ef0..9568627e 100644 --- a/toys/other/losetup.c +++ b/toys/other/losetup.c @@ -112,7 +112,7 @@ static void loopback_setup(char *device, char *file) if (ioctl(lfd, LOOP_SET_FD, ffd)) perror_exit("%s=%s", device, file); loop->lo_offset = TT.offset; loop->lo_sizelimit = TT.size; - strncpy((char *)loop->lo_file_name, s, LO_NAME_SIZE); + xstrncpy((char *)loop->lo_file_name, s, LO_NAME_SIZE); s[LO_NAME_SIZE-1] = 0; if (ioctl(lfd, LOOP_SET_STATUS64, loop)) perror_exit("%s=%s", device, file); if (flags & FLAG_s) printf("%s", device); |