summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/tools.c3
-rw-r--r--mdk-stage1/url.c8
2 files changed, 2 insertions, 9 deletions
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c
index 36185bcfb..17a4774fd 100644
--- a/mdk-stage1/tools.c
+++ b/mdk-stage1/tools.c
@@ -451,8 +451,7 @@ int kernel_version(void)
int try_mount(char * dev, char * location)
{
char device_fullname[50];
- strcpy(device_fullname, "/dev/");
- strcat(device_fullname, dev);
+ snprintf(device_fullname, sizeof(device_fullname), "/dev/%s", dev);
if (my_mount(device_fullname, location, "ext2", 0) == -1 &&
my_mount(device_fullname, location, "vfat", 0) == -1 &&
diff --git a/mdk-stage1/url.c b/mdk-stage1/url.c
index ea155419c..808bfd057 100644
--- a/mdk-stage1/url.c
+++ b/mdk-stage1/url.c
@@ -136,13 +136,7 @@ static int ftp_command(int sock, char * command, char * param)
char buf[500];
int rc;
- strcpy(buf, command);
- if (param) {
- strcat(buf, " ");
- strcat(buf, param);
- }
-
- strcat(buf, "\r\n");
+ snprintf(buf, sizeof(buf), "%s%s%s\r\n", command, param ? " " : "", param ? param : "");
if (write(sock, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
return FTPERR_SERVER_IO_ERROR;