Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pdfio2.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ FILE *fp;
fname, __func__, NULL);

/* Optionally, encode the compressed data */
if (ascii85flag == 1) {
if (ascii85flag) {
data85 = encodeAscii85(data, nbytes, &nbytes85);
LEPT_FREE(data);
if (!data85)
Expand All @@ -966,7 +966,7 @@ FILE *fp;
}

cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
if (ascii85flag == 0) {
if (!ascii85flag) {
cid->datacomp = data;
} else { /* ascii85 */
cid->data85 = data85;
Expand Down
12 changes: 7 additions & 5 deletions src/utils2.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@

#ifdef __APPLE__
#include <unistd.h>
#include <errno.h>
#endif

#include <errno.h> /* for errno */
#include <string.h>
#include <stddef.h>
#include "allheaders.h"
Expand Down Expand Up @@ -2174,11 +2174,11 @@ l_uint32 attributes;
sarraySplitString(sa, subdir, "/");
n = sarrayGetCount(sa);
dir = genPathname("/tmp", NULL);
ret = 0; /* don't check ret values with unix because if a directory
* exists, mkdir() returns -1 */
/* Make sure the tmp directory exists */
#ifndef _WIN32
mkdir(dir, 0777);
if (mkdir(dir, 0777) != 0 && errno != EEXIST) {
++ret;
}
#else
attributes = GetFileAttributesA(dir);
if (attributes == INVALID_FILE_ATTRIBUTES)
Expand All @@ -2188,7 +2188,9 @@ l_uint32 attributes;
for (i = 0; i < n; i++) {
tmpdir = pathJoin(dir, sarrayGetString(sa, i, L_NOCOPY));
#ifndef _WIN32
mkdir(tmpdir, 0777);
if (mkdir(tmpdir, 0777) != 0 && errno != EEXIST) {
++ret;
}
#else
if (CreateDirectoryA(tmpdir, NULL) == 0)
ret += (GetLastError() != ERROR_ALREADY_EXISTS);
Expand Down
Loading