From 30ded6fed94a11a7257402a98d4483d8681257f2 Mon Sep 17 00:00:00 2001 From: Yang Kun <91833768+ikspress@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:38:05 +0800 Subject: [PATCH 1/2] Update nfc-utils --- src/nfc-utils.c | 3 ++- src/nfc-utils.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nfc-utils.c b/src/nfc-utils.c index 5c0a264..72a33ed 100644 --- a/src/nfc-utils.c +++ b/src/nfc-utils.c @@ -7,6 +7,7 @@ * Copyright (C) 2010-2012 Romain Tartière * Copyright (C) 2010-2013 Philippe Teuwen * Copyright (C) 2012-2013 Ludovic Rousseau + * See AUTHORS file for a more comprehensive list of contributors. * Additional contributors of this file: * * Redistribution and use in source and binary forms, with or without @@ -45,7 +46,7 @@ uint8_t oddparity(const uint8_t bt) { // cf http://graphics.stanford.edu/~seander/bithacks.html#ParityParallel - return (0x9669 >> ((bt ^(bt >> 4)) & 0xF)) & 1; + return (0x9669 >> ((bt ^ (bt >> 4)) & 0xF)) & 1; } void diff --git a/src/nfc-utils.h b/src/nfc-utils.h index 8c52d4c..3711788 100644 --- a/src/nfc-utils.h +++ b/src/nfc-utils.h @@ -7,6 +7,7 @@ * Copyright (C) 2010-2012 Romain Tartière * Copyright (C) 2010-2013 Philippe Teuwen * Copyright (C) 2012-2013 Ludovic Rousseau + * See AUTHORS file for a more comprehensive list of contributors. * Additional contributors of this file: * * Redistribution and use in source and binary forms, with or without From 4608ed6dbca9e3e54f5f7ff6637771cbe9a30952 Mon Sep 17 00:00:00 2001 From: Yang Kun <91833768+ikspress@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:03:52 +0800 Subject: [PATCH 2/2] Rename errno to code --- src/mfoc.c | 4 ++-- src/mfoc.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mfoc.c b/src/mfoc.c index 9887553..e1a1655 100644 --- a/src/mfoc.c +++ b/src/mfoc.c @@ -753,7 +753,7 @@ int main(int argc, char *const argv[]) exit(EXIT_FAILURE); } -void usage(FILE *stream, int errno) +void usage(FILE *stream, int code) { fprintf(stream, "Usage: mfoc [-h] [-k key] [-f file] ... [-P probnum] [-T tolerance] [-O output]\n"); fprintf(stream, "\n"); @@ -776,7 +776,7 @@ void usage(FILE *stream, int errno) fprintf(stream, "\n"); fprintf(stream, "This is mfoc version %s.\n", PACKAGE_VERSION); fprintf(stream, "For more information, run: 'man mfoc'.\n"); - exit(errno); + exit(code); } void mf_init(mfreader *r) diff --git a/src/mfoc.h b/src/mfoc.h index 9ea7547..c026aa9 100644 --- a/src/mfoc.h +++ b/src/mfoc.h @@ -82,7 +82,7 @@ typedef struct { } countKeys; -void usage(FILE *stream, int errno); +void usage(FILE *stream, int code); void mf_init(mfreader *r); void mf_configure(nfc_device *pdi); void mf_select_tag(nfc_device *pdi, nfc_target *pnt);