home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix textfile_width() line length check position.
[plomrogue]
/
src
/
common
/
readwrite.c
diff --git
a/src/common/readwrite.c
b/src/common/readwrite.c
index a0ab3f7cf5ccfef0f7bc7350a5066aa3df13c623..c2c970d292cb9579d5e6fddc64eb733ac3524246 100644
(file)
--- a/
src/common/readwrite.c
+++ b/
src/common/readwrite.c
@@
-2,7
+2,7
@@
#include "readwrite.h"
#include <stddef.h> /* size_t */
#include "readwrite.h"
#include <stddef.h> /* size_t */
-#include <stdint.h> /* uint8_t, uint16_t, uint32_t */
+#include <stdint.h> /* uint8_t, uint16_t, uint32_t
, UINT32_MAX
*/
#include <stdio.h> /* FILE, fseek(), sprintf(), fgets(), fgetc(), ferror(),
* fputc(), fwrite(), fclose(), fopen()
*/
#include <stdio.h> /* FILE, fseek(), sprintf(), fgets(), fgetc(), ferror(),
* fputc(), fwrite(), fclose(), fopen()
*/
@@
-109,6
+109,7
@@
extern uint32_t textfile_width(FILE * file)
break;
}
c_count++;
break;
}
c_count++;
+ exit_trouble(UINT32_MAX == c_count, f_name, "too large text file line");
if ('\n' == c)
{
if (c_count > linemax)
if ('\n' == c)
{
if (c_count > linemax)