summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mklocale/yacc.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y
index 4024f6720227..344af220cf6b 100644
--- a/usr.bin/mklocale/yacc.y
+++ b/usr.bin/mklocale/yacc.y
@@ -730,8 +730,8 @@ dump_tables()
/*
* PART 6: And finally the variable data
*/
- if (fwrite(variable,
- ntohl(new_locale.variable_len), 1, fp) != 1) {
+ if (new_locale.variable_len != 0 &&
+ fwrite(variable, ntohl(new_locale.variable_len), 1, fp) != 1) {
perror(locale_file);
exit(1);
}