Skip to content

Commit

Permalink
Quieting the voices (of -pedantic).
Browse files Browse the repository at this point in the history
  • Loading branch information
Tordek committed Aug 15, 2012
1 parent dc136b4 commit 77972c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion cheat.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ static void cheat_test_end(struct cheat_test_suite *suite)

static void cheat_log_append(struct cheat_test_suite *suite, char *message, int len)
{
char *buf;

if (len == 0) {
return;
}

char * const buf = malloc(len + 1);
buf = malloc(len + 1);
memcpy(buf, message, len);

buf[len] = '\0';
Expand Down
10 changes: 6 additions & 4 deletions cheat_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ int cheat_stream_contains(FILE *stream, char const *contents);
#define dup2 _dup2

int mkstemp(char * pattern) {
// TODO: Generate a uUnique to avoid using CREATE_ALWAYS.
// Even better: get rid of this, and try to open in a do..while loop
// to match mkstemp.
/*
* TODO: Generate a uUnique to avoid using CREATE_ALWAYS.
* Even better: get rid of this, and try to open in a do..while loop
* to match mkstemp.
*/
char tempFileName[MAX_PATH];
GetTempFileName(
".",
Expand All @@ -35,7 +37,7 @@ int mkstemp(char * pattern) {
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS, // Bad. Should be _NEW, to avoid races.
CREATE_ALWAYS, /* Bad. Should be _NEW, to avoid races. */
0,
NULL);

Expand Down

0 comments on commit 77972c0

Please sign in to comment.