1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

fixed some bugs

This commit is contained in:
kojima
2004-10-26 03:03:02 +00:00
parent 087a16400f
commit bbd1e5dada
6 changed files with 11 additions and 11 deletions

View File

@@ -51,12 +51,12 @@ wstrerror(int errnum)
if (errno < sys_nerr) if (errno < sys_nerr)
return sys_errlist[errnum]; return sys_errlist[errnum];
sprintf (buf, _("Unknown error %d"), errnum); snprintf(buf, sizeof(buf), _("Unknown error %d"), errnum);
return buf; return buf;
#else /* no strerror() and no sys_errlist[] */ #else /* no strerror() and no sys_errlist[] */
static char buf[] = "Error 12345678901234567890"; static char buf[] = "Error 12345678901234567890";
sprintf(buf, _("Error %d"), errnum); snprintf(buf, sizeof(buf), _("Error %d"), errnum);
return buf; return buf;
#endif #endif
} }

View File

@@ -24,7 +24,7 @@ POTFILES = \
SUFFIXES = .po .mo SUFFIXES = .po .mo
.po.mo: .po.mo:
msgfmt -o $@ $< msgfmt -c -o $@ $<
all-local: $(CATALOGS) all-local: $(CATALOGS)

View File

@@ -24,11 +24,11 @@ xlfdToFcPattern(char *xlfd, int size)
FcPattern *pattern; FcPattern *pattern;
char *fname, *ptr; char *fname, *ptr;
fname = wmalloc(strlen(xlfd) + 20); if (strchr(xlfd, "%")!=NULL)
if (strstr(xlfd, "%d")!=NULL) return FcNameParse("sans:pixelsize=12");
sprintf(fname, xlfd, size ? size : DEFAULT_SIZE); else {
else fname= wstrdup(xlfd);
strcpy(fname, xlfd); }
if ((ptr = strchr(fname, ','))) { if ((ptr = strchr(fname, ','))) {
*ptr = 0; *ptr = 0;

View File

@@ -32,7 +32,7 @@ POTFILES = \
SUFFIXES = .po .mo SUFFIXES = .po .mo
.po.mo: .po.mo:
msgfmt -o $@ $< msgfmt -c -o $@ $<
all-local: $(CATALOGS) all-local: $(CATALOGS)

View File

@@ -41,7 +41,7 @@ POTFILES = \
SUFFIXES = .po .mo SUFFIXES = .po .mo
.po.mo: .po.mo:
msgfmt -o $@ $< msgfmt -c -o $@ $<
all-local: $(CATALOGS) all-local: $(CATALOGS)

View File

@@ -1299,7 +1299,7 @@ wWorkspaceRename(WScreen *scr, int workspace, char *name)
tmp = cropline(name); tmp = cropline(name);
if (strlen(tmp)==0) { if (strlen(tmp)==0) {
sprintf(buf, _("Workspace %i"), workspace+1); snprintf(buf, sizeof(buf), _("Workspace %i"), workspace+1);
} else { } else {
strncpy(buf, tmp, MAX_WORKSPACENAME_WIDTH); strncpy(buf, tmp, MAX_WORKSPACENAME_WIDTH);
} }