aboutsummaryrefslogtreecommitdiff
path: root/libxkbfile/src/xkmread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libxkbfile/src/xkmread.c')
-rw-r--r--libxkbfile/src/xkmread.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/libxkbfile/src/xkmread.c b/libxkbfile/src/xkmread.c
index f22941f67..eb190ba6f 100644
--- a/libxkbfile/src/xkmread.c
+++ b/libxkbfile/src/xkmread.c
@@ -76,19 +76,6 @@ XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
#define SEEK_SET 0
#endif
-char *
-_XkbDupString(char *str)
-{
-char *new;
-
- if (str==NULL)
- return NULL;
- new= (char *)_XkbCalloc(strlen(str)+1,sizeof(char));
- if (new)
- strcpy(new,str);
- return new;
-}
-
/***====================================================================***/
static XPointer
@@ -1208,7 +1195,7 @@ xkmSectionInfo tmpTOC;
char name[100];
if ((!file)||(!toc))
- return 0;
+ return NULL;
switch (toc->type) {
case XkmVirtualModsIndex:
case XkmIndicatorsIndex:
@@ -1223,12 +1210,14 @@ char name[100];
if ((tmpTOC.type!=toc->type)||(tmpTOC.format!=toc->format)||
(tmpTOC.size!=toc->size)||(tmpTOC.offset!=toc->offset)) {
_XkbLibError(_XkbErrIllegalContents,"XkmReadFileSectionName",0);
- return 0;
+ return NULL;
}
if (XkmGetCountedString(file,name,100)>0)
return _XkbDupString(name);
break;
default:
+ fseek(file,toc->offset,SEEK_SET);
+ fread(&tmpTOC,SIZEOF(xkmSectionInfo),1,file);
_XkbLibError(_XkbErrBadImplementation,
XkbConfigText(tmpTOC.type,XkbMessage),0);
break;