summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-21 17:58:08 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-08-21 17:58:08 +0000
commit363a37d52016e0a16e3599d690f610346fc6898a (patch)
tree35ce1129736b9c6833c2e5eda5c6015b7897c67f /monitor.c
parentc93e7817ee963d9441f6706d6f194ff02cec690f (diff)
downloadqemu-363a37d52016e0a16e3599d690f610346fc6898a.tar.gz
Fix OpenBSD linker warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/monitor.c b/monitor.c
index 47c5514745..e71f49e85f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2251,7 +2251,7 @@ static void monitor_handle_command(const char *cmdline)
goto fail;
}
str = qemu_malloc(strlen(buf) + 1);
- strcpy(str, buf);
+ pstrcpy(str, sizeof(buf), buf);
str_allocated[nb_args] = str;
add_str:
if (nb_args >= MAX_ARGS) {
@@ -2518,7 +2518,7 @@ static void file_completion(const char *input)
if (!p) {
input_path_len = 0;
pstrcpy(file_prefix, sizeof(file_prefix), input);
- strcpy(path, ".");
+ pstrcpy(path, sizeof(path), ".");
} else {
input_path_len = p - input + 1;
memcpy(path, input, input_path_len);
@@ -2540,13 +2540,15 @@ static void file_completion(const char *input)
break;
if (strstart(d->d_name, file_prefix, NULL)) {
memcpy(file, input, input_path_len);
- strcpy(file + input_path_len, d->d_name);
+ if (input_path_len < sizeof(file))
+ pstrcpy(file + input_path_len, sizeof(file) - input_path_len,
+ d->d_name);
/* stat the file to find out if it's a directory.
* In that case add a slash to speed up typing long paths
*/
stat(file, &sb);
if(S_ISDIR(sb.st_mode))
- strcat(file, "/");
+ pstrcat(file, sizeof(file), "/");
add_completion(file);
}
}