diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-11-07 21:54:54 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-11-07 21:54:54 -0800 |
commit | 342d3a8f74bf272235c5eca2b62bd63d3e1e556d (patch) | |
tree | b555ec2276482b5f166d562fd01d5d669ec5b0e9 | |
parent | e616514e74e8120869bb4b04f12e6c0fcb45d27f (diff) |
Use SEEK_* names instead of raw numbers for fseek whence argument
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/AsciiSrc.c | 4 | ||||
-rw-r--r-- | src/MultiSrc.c | 4 | ||||
-rw-r--r-- | src/TextPop.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/AsciiSrc.c b/src/AsciiSrc.c index ff7b9df..cdc6277 100644 --- a/src/AsciiSrc.c +++ b/src/AsciiSrc.c @@ -1032,7 +1032,7 @@ InitStringOrFile(AsciiSrcObject src, Boolean newString) if (!src->ascii_src.is_tempfile) { if ((file = fopen(src->ascii_src.string, open_mode)) != 0) { - (void) fseek(file, 0, 2); + (void) fseek(file, 0, SEEK_END); src->ascii_src.length = (XawTextPosition) ftell(file); return file; } else { @@ -1062,7 +1062,7 @@ LoadPieces(AsciiSrcObject src, FILE * file, char * string) local_str = XtMalloc((unsigned) (src->ascii_src.length + 1) * sizeof(unsigned char)); if (src->ascii_src.length != 0) { - fseek(file, 0, 0); + fseek(file, 0, SEEK_SET); src->ascii_src.length = fread(local_str, sizeof(unsigned char), (size_t)src->ascii_src.length, file); if (src->ascii_src.length <= 0) diff --git a/src/MultiSrc.c b/src/MultiSrc.c index 3ea875b..7ad3cdd 100644 --- a/src/MultiSrc.c +++ b/src/MultiSrc.c @@ -1118,7 +1118,7 @@ InitStringOrFile(MultiSrcObject src, Boolean newString) if (!src->multi_src.is_tempfile) { if ((file = fopen(src->multi_src.string, open_mode)) != 0) { - (void) fseek(file, 0, 2); + (void) fseek(file, 0, SEEK_END); src->multi_src.length = ftell (file); return file; } else { @@ -1182,7 +1182,7 @@ LoadPieces(MultiSrcObject src, FILE *file, char *string) if (src->multi_src.length != 0) { temp_mb_holder = XtMalloc((unsigned)(src->multi_src.length + 1) * sizeof(unsigned char)); - fseek(file, 0, 0); + fseek(file, 0, SEEK_SET); src->multi_src.length = fread (temp_mb_holder, sizeof(unsigned char), (size_t)src->multi_src.length, file); diff --git a/src/TextPop.c b/src/TextPop.c index 9f625b9..00fe7af 100644 --- a/src/TextPop.c +++ b/src/TextPop.c @@ -279,7 +279,7 @@ InsertFileNamed(Widget tw, char *str) pos = XawTextGetInsertionPoint(tw); - fseek(file, 0L, 2); + fseek(file, 0L, SEEK_END); text.firstPos = 0; @@ -287,7 +287,7 @@ InsertFileNamed(Widget tw, char *str) text.ptr = XtMalloc((text.length + 1) * sizeof(unsigned char)); text.format = XawFmt8Bit; - fseek(file, 0L, 0); + fseek(file, 0L, SEEK_SET); if (fread(text.ptr, sizeof(unsigned char), text.length, file) != text.length) XtErrorMsg("readError", "insertFileNamed", "XawError", "fread returned error.", NULL, NULL); |