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
1 change: 0 additions & 1 deletion src/nfc-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* @brief Provide some examples shared functions like print, parity calculation, options parsing.
*/
#include <nfc/nfc.h>
#include <err.h>

#include "nfc-utils.h"

Expand Down
15 changes: 14 additions & 1 deletion src/nfc-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,20 @@

# include <stdlib.h>
# include <string.h>
# include <err.h>
# ifdef _WIN32
# include <stdio.h>
# include <stdarg.h>
static inline void warnx(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, "\n");
}
# else
# include <err.h>
# endif
# include <nfc/nfc-types.h>

/**
Expand Down
18 changes: 9 additions & 9 deletions src/stdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ int setenv(const char *name, const char *value, int overwrite)
{
char *env = getenv(name);
if ((env && overwrite) || (!env)) {
char *str[32];
strcpy(*str, name);
strcat(*str, "=");
strcat(*str, value);
return _putenv(*str);
char str[32];
strcpy(str, name);
strcat(str, "=");
strcat(str, value);
return _putenv(str);
}
return -1;
}

void unsetenv(const char *name)
{
char *str[32];
strcpy(*str, name);
strcat(*str, "=");
_putenv(*str);
char str[32];
strcpy(str, name);
strcat(str, "=");
_putenv(str);
}
1 change: 0 additions & 1 deletion src/windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

# include <windows.h>
# include <winerror.h>
# include <err.h>
# if defined (__MINGW32__)
/*
* Cheating here on the snprintf to incorporate the format argument
Expand Down