[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/src/Attic/output.c,v [branch-1_4]
From: |
Eric Blake |
Subject: |
Changes to m4/src/Attic/output.c,v [branch-1_4] |
Date: |
Thu, 26 Oct 2006 21:11:57 +0000 |
CVSROOT: /sources/m4
Module name: m4
Branch: branch-1_4
Changes by: Eric Blake <ericb> 06/10/26 21:11:56
Index: src/output.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/output.c,v
retrieving revision 1.1.1.1.2.12
retrieving revision 1.1.1.1.2.13
diff -u -b -r1.1.1.1.2.12 -r1.1.1.1.2.13
--- src/output.c 26 Oct 2006 04:45:31 -0000 1.1.1.1.2.12
+++ src/output.c 26 Oct 2006 21:11:56 -0000 1.1.1.1.2.13
@@ -379,7 +379,7 @@
current_line, output_current_line);
#endif
- /* Output a `#line NUM' synchronisation directive if needed.
+ /* Output a `#line NUM' synchronization directive if needed.
If output_current_line was previously given a negative
value (invalidated), rather output `#line NUM "FILE"'. */
@@ -585,7 +585,11 @@
fflush (diversion->file);
if (fstat (fileno (diversion->file), &file_stat) < 0)
M4ERROR ((EXIT_FAILURE, errno, "cannot stat diversion"));
- fprintf (file, "D%d,%d", divnum, (int) file_stat.st_size);
+ if (file_stat.st_size < 0
+ || file_stat.st_size != (unsigned long) file_stat.st_size)
+ M4ERROR ((EXIT_FAILURE, 0, "diversion too large"));
+ fprintf (file, "D%d,%lu", divnum,
+ (unsigned long int) file_stat.st_size);
}
else
fprintf (file, "D%d,%d\n", divnum, diversion->used);