diff options
Diffstat (limited to 'xorg-server/xkb/ddxLoad.c')
-rw-r--r-- | xorg-server/xkb/ddxLoad.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c index 219d39c9a..196142318 100644 --- a/xorg-server/xkb/ddxLoad.c +++ b/xorg-server/xkb/ddxLoad.c @@ -263,8 +263,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, if (xkbDebugFlags) DebugF("[xkb] xkb executes: %s\n",buf); if (nameRtrn) { - strncpy(nameRtrn,keymap,nameRtrnLen); - nameRtrn[nameRtrnLen-1]= '\0'; + strlcpy(nameRtrn,keymap,nameRtrnLen); } free(buf); #ifdef WIN32 @@ -322,8 +321,7 @@ FILE * file; } else file= NULL; if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) { - strncpy(fileNameRtrn,buf,fileNameRtrnLen); - buf[fileNameRtrnLen-1]= '\0'; + strlcpy(fileNameRtrn,buf,fileNameRtrnLen); } return file; } |