summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-25 17:48:40 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-25 17:48:40 +0200
commit1c195ab280da561f38e54449e4eb3d6882c69b3b (patch)
tree12583570730c9e5a1505416aa445666aa1449f6b /src
parentd7aa6d1b2d6f3fc48b8287ea04c741078b22f2da (diff)
Fix strncpy length parameters to avoid non-nul-terminated strings
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 80b4636e..a7afcbf8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -189,7 +189,8 @@ static void parse_config(GKeyFile *config)
g_clear_error(&err);
} else {
debug("deviceid=%s", str);
- strncpy(main_opts.deviceid, str, sizeof(main_opts.deviceid));
+ strncpy(main_opts.deviceid, str,
+ sizeof(main_opts.deviceid) - 1);
g_free(str);
}