mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Do fopen() with 'b' for binary data on windoze
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4200 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
09da576af0
commit
3d937a19bb
2 changed files with 7 additions and 7 deletions
|
@ -124,7 +124,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len, NSZone* zone)
|
|||
NSLog(@"Open (%s) attempt failed - bad path", thePath);
|
||||
return NO;
|
||||
}
|
||||
theFile = fopen(thePath, "r");
|
||||
theFile = fopen(thePath, "rb");
|
||||
|
||||
if (theFile == NULL) /* We failed to open the file. */
|
||||
{
|
||||
|
@ -175,7 +175,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len, NSZone* zone)
|
|||
c = fread(tmp, 1, fileLength, theFile);
|
||||
if (c != fileLength)
|
||||
{
|
||||
NSLog(@"Fread of file contents failed - %s", strerror(errno));
|
||||
NSLog(@"read of file contents failed - %s", strerror(errno));
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,7 @@ failure:
|
|||
else
|
||||
{
|
||||
strcpy(thePath, theRealPath);
|
||||
theFile = fopen(thePath, "w");
|
||||
theFile = fopen(thePath, "wb");
|
||||
}
|
||||
#else
|
||||
if (useAuxiliaryFile)
|
||||
|
@ -545,7 +545,7 @@ failure:
|
|||
}
|
||||
|
||||
/* Open the file (whether temp or real) for writing. */
|
||||
theFile = fopen(thePath, "w");
|
||||
theFile = fopen(thePath, "wb");
|
||||
#endif
|
||||
|
||||
if (theFile == NULL) /* Something went wrong; we weren't
|
||||
|
|
|
@ -544,7 +544,7 @@ decode (const void *ptr)
|
|||
|
||||
if (f)
|
||||
{
|
||||
fp = fopen([f cString], "r");
|
||||
fp = fopen([f cString], "rb");
|
||||
if (fp != NULL)
|
||||
{
|
||||
if (fscanf(fp, "%79s", zone_name) == 1)
|
||||
|
@ -779,7 +779,7 @@ decode (const void *ptr)
|
|||
/* Read dictionary from file. */
|
||||
abbreviationDictionary = [[NSMutableDictionary alloc] init];
|
||||
fileName = [NSTimeZone getAbbreviationFile];
|
||||
file = fopen([fileName cString], "r");
|
||||
file = fopen([fileName cString], "rb");
|
||||
if (file == NULL)
|
||||
[NSException
|
||||
raise: NSInternalInconsistencyException
|
||||
|
@ -826,7 +826,7 @@ decode (const void *ptr)
|
|||
temp_array[i] = [[NSMutableArray alloc] init];
|
||||
|
||||
fileName = [NSTimeZone getRegionsFile];
|
||||
file = fopen([fileName cString], "r");
|
||||
file = fopen([fileName cString], "rb");
|
||||
if (file == NULL)
|
||||
[NSException
|
||||
raise: NSInternalInconsistencyException
|
||||
|
|
Loading…
Reference in a new issue