mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
QRCODE: check fopen()
return in ZINTLOG debugging code
(ticket #181, props Stf Ortm) CODE128: suppress gcc -Wmaybe-uninitialized false positive (Release only) CLI: add "isbn" synonym; save a few bytes using `char[]` rather than `char *`
This commit is contained in:
@ -131,7 +131,7 @@ static void c128_grwp(int list[2][C128_MAX], int *p_indexliste) {
|
||||
* Implements rules from ISO 15417 Annex E
|
||||
*/
|
||||
INTERNAL void c128_dxsmooth(int list[2][C128_MAX], int *p_indexliste, const char *manual_set) {
|
||||
int i, j, nextshift, nextshift_i = 0;
|
||||
int i, j, nextshift = 0 /*Suppresses gcc -Wmaybe-uninitialized false positive*/, nextshift_i = 0;
|
||||
const int indexliste = *p_indexliste;
|
||||
|
||||
for (i = 0; i < indexliste; i++) {
|
||||
|
20
backend/qr.c
20
backend/qr.c
@ -1060,22 +1060,22 @@ static void qr_populate_grid(unsigned char *grid, const int h_size, const int v_
|
||||
}
|
||||
|
||||
#ifdef ZINTLOG
|
||||
static int append_log(unsigned char log) {
|
||||
static void append_log(const unsigned char log) {
|
||||
FILE *file;
|
||||
|
||||
file = fopen("zintlog.txt", "a+");
|
||||
fprintf(file, "%02X", log);
|
||||
(void) fclose(file);
|
||||
return 0;
|
||||
if ((file = fopen("zintlog.txt", "a+"))) {
|
||||
fprintf(file, "%02X", log);
|
||||
(void) fclose(file);
|
||||
}
|
||||
}
|
||||
|
||||
static int write_log(char log[]) {
|
||||
static void write_log(const char log[]) {
|
||||
FILE *file;
|
||||
|
||||
file = fopen("zintlog.txt", "a+");
|
||||
fprintf(file, "%s\n", log); /*writes*/
|
||||
(void) fclose(file);
|
||||
return 0;
|
||||
if ((file = fopen("zintlog.txt", "a+"))) {
|
||||
fprintf(file, "%s\n", log); /*writes*/
|
||||
(void) fclose(file);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user