aboutsummaryrefslogtreecommitdiff
path: root/libxkbfile/src/xkmread.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-10-07 09:21:18 +0000
committermarha <marha@users.sourceforge.net>2009-10-07 09:21:18 +0000
commitb741086f4b268041e1c171c6dc4bb9182e7666d3 (patch)
tree02dfe9fd170cddb55b6532de49768133221ef3b6 /libxkbfile/src/xkmread.c
parentf78ab58911de1fa9a15afffcd4fcdc11ae67c646 (diff)
parentc73dc01b6de45612b24dc2dd34fba24d81ebf46c (diff)
downloadvcxsrv-b741086f4b268041e1c171c6dc4bb9182e7666d3.tar.gz
vcxsrv-b741086f4b268041e1c171c6dc4bb9182e7666d3.tar.bz2
vcxsrv-b741086f4b268041e1c171c6dc4bb9182e7666d3.zip
svn merge ^/branches/released .
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;