From bbd1e5dadaf2d30294cacb572a4c9dad4db84ef3 Mon Sep 17 00:00:00 2001 From: kojima Date: Tue, 26 Oct 2004 03:03:02 +0000 Subject: [PATCH] fixed some bugs --- WINGs/error.c | 4 ++-- WINGs/po/Makefile.am | 2 +- WINGs/wfont.c | 10 +++++----- WPrefs.app/po/Makefile.am | 2 +- po/Makefile.am | 2 +- src/workspace.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/WINGs/error.c b/WINGs/error.c index 5d10df1d..8881459c 100644 --- a/WINGs/error.c +++ b/WINGs/error.c @@ -51,12 +51,12 @@ wstrerror(int errnum) if (errno < sys_nerr) return sys_errlist[errnum]; - sprintf (buf, _("Unknown error %d"), errnum); + snprintf(buf, sizeof(buf), _("Unknown error %d"), errnum); return buf; #else /* no strerror() and no sys_errlist[] */ static char buf[] = "Error 12345678901234567890"; - sprintf(buf, _("Error %d"), errnum); + snprintf(buf, sizeof(buf), _("Error %d"), errnum); return buf; #endif } diff --git a/WINGs/po/Makefile.am b/WINGs/po/Makefile.am index 69409971..7f4c305d 100644 --- a/WINGs/po/Makefile.am +++ b/WINGs/po/Makefile.am @@ -24,7 +24,7 @@ POTFILES = \ SUFFIXES = .po .mo .po.mo: - msgfmt -o $@ $< + msgfmt -c -o $@ $< all-local: $(CATALOGS) diff --git a/WINGs/wfont.c b/WINGs/wfont.c index 68f950fe..56444a76 100644 --- a/WINGs/wfont.c +++ b/WINGs/wfont.c @@ -24,11 +24,11 @@ xlfdToFcPattern(char *xlfd, int size) FcPattern *pattern; char *fname, *ptr; - fname = wmalloc(strlen(xlfd) + 20); - if (strstr(xlfd, "%d")!=NULL) - sprintf(fname, xlfd, size ? size : DEFAULT_SIZE); - else - strcpy(fname, xlfd); + if (strchr(xlfd, "%")!=NULL) + return FcNameParse("sans:pixelsize=12"); + else { + fname= wstrdup(xlfd); + } if ((ptr = strchr(fname, ','))) { *ptr = 0; diff --git a/WPrefs.app/po/Makefile.am b/WPrefs.app/po/Makefile.am index 52eb2bee..50c9cde2 100644 --- a/WPrefs.app/po/Makefile.am +++ b/WPrefs.app/po/Makefile.am @@ -32,7 +32,7 @@ POTFILES = \ SUFFIXES = .po .mo .po.mo: - msgfmt -o $@ $< + msgfmt -c -o $@ $< all-local: $(CATALOGS) diff --git a/po/Makefile.am b/po/Makefile.am index 7655a1fe..b1f2b40d 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -41,7 +41,7 @@ POTFILES = \ SUFFIXES = .po .mo .po.mo: - msgfmt -o $@ $< + msgfmt -c -o $@ $< all-local: $(CATALOGS) diff --git a/src/workspace.c b/src/workspace.c index aa5b79f5..fd27b83f 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -1299,7 +1299,7 @@ wWorkspaceRename(WScreen *scr, int workspace, char *name) tmp = cropline(name); if (strlen(tmp)==0) { - sprintf(buf, _("Workspace %i"), workspace+1); + snprintf(buf, sizeof(buf), _("Workspace %i"), workspace+1); } else { strncpy(buf, tmp, MAX_WORKSPACENAME_WIDTH); } -- 2.11.4.GIT