diff options
Diffstat (limited to 'xkb/maprules.c')
-rw-r--r-- | xkb/maprules.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/xkb/maprules.c b/xkb/maprules.c index f94089982..a14fbbb2a 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -250,8 +250,7 @@ get_index(char *str, int *ndx) *ndx = -1; return end + 1; } - strncpy(ndx_buf, str, end - str); - ndx_buf[end - str] = '\0'; + strlcpy(ndx_buf, str, 1 + end - str); *ndx = atoi(ndx_buf); return end + 1; } |