Page MenuHomeFreeBSD

D10704.id28330.diff
No OneTemporary

D10704.id28330.diff

Index: head/usr.bin/localedef/localedef.h
===================================================================
--- head/usr.bin/localedef/localedef.h
+++ head/usr.bin/localedef/localedef.h
@@ -35,6 +35,7 @@
*/
/* Common header files. */
+#include <sys/cdefs.h>
#include <sys/types.h>
#include <stdarg.h>
#include <stdio.h>
@@ -54,8 +55,8 @@
int yylex(void);
void yyerror(const char *);
-void errf(const char *, ...);
-void warn(const char *, ...);
+_Noreturn void errf(const char *, ...) __printflike(1, 2);
+void warn(const char *, ...) __printflike(1, 2);
int putl_category(const char *, FILE *);
int wr_category(void *, size_t, FILE *);
Index: head/usr.bin/localedef/localedef.c
===================================================================
--- head/usr.bin/localedef/localedef.c
+++ head/usr.bin/localedef/localedef.c
@@ -119,7 +119,7 @@
*/
file = fopen(category_file(), "w");
if (file == NULL) {
- errf(strerror(errno));
+ errf("%s", strerror(errno));
return (NULL);
}
return (file);
@@ -131,11 +131,11 @@
if (fchmod(fileno(f), 0644) < 0) {
(void) fclose(f);
(void) unlink(category_file());
- errf(strerror(errno));
+ errf("%s", strerror(errno));
}
if (fclose(f) < 0) {
(void) unlink(category_file());
- errf(strerror(errno));
+ errf("%s", strerror(errno));
}
if (verbose) {
(void) fprintf(stdout, "done.\n");
@@ -195,13 +195,13 @@
if (s && fputs(s, f) == EOF) {
(void) fclose(f);
(void) unlink(category_file());
- errf(strerror(errno));
+ errf("%s", strerror(errno));
return (EOF);
}
if (fputc('\n', f) == EOF) {
(void) fclose(f);
(void) unlink(category_file());
- errf(strerror(errno));
+ errf("%s", strerror(errno));
return (EOF);
}
return (0);
@@ -216,7 +216,7 @@
if (fwrite(buf, sz, 1, f) < 1) {
(void) fclose(f);
(void) unlink(category_file());
- errf(strerror(errno));
+ errf("%s", strerror(errno));
return (EOF);
}
return (0);
@@ -331,7 +331,7 @@
while ((dir = opendir(locname)) == NULL) {
if ((errno != ENOENT) ||
(mkdir(locname, 0755) < 0)) {
- errf(strerror(errno));
+ errf("%s", strerror(errno));
}
}
(void) closedir(dir);
Index: head/usr.bin/localedef/wide.c
===================================================================
--- head/usr.bin/localedef/wide.c
+++ head/usr.bin/localedef/wide.c
@@ -598,7 +598,7 @@
int rv;
if ((rv = _tomb(mb, wc)) < 0) {
- errf(widemsg);
+ warn("%s", widemsg);
free(widemsg);
widemsg = NULL;
}
@@ -614,7 +614,7 @@
mbs = malloc((wcslen(wcs) * mb_cur_max) + 1);
if (mbs == NULL) {
- errf("out of memory");
+ warn("out of memory");
return (NULL);
}
ptr = mbs;

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 28, 1:46 AM (3 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37404463
Default Alt Text
D10704.id28330.diff (2 KB)

Event Timeline