Skip to content

Commit 1cf98c5

Browse files
committed
SZBOOK
1 parent 1de9723 commit 1cf98c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src-macro/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "./main.auto.h"
22
#include <stdio.h>
33

4-
#define BOOK ae2f_MAC_KEYWORD "("
4+
#define BOOK (ae2f_MAC_KEYWORD "(")
55

66
#if CMT_REQUIRED
77
#define dbg_printf(s, ...) fprintf(stdout, s, __VA_ARGS__)
@@ -11,7 +11,7 @@
1111
#define dbg_puts(s)
1212
#endif
1313

14-
#define SZBOOK (sizeof(BOOK) - 1)
14+
#define SZBOOK (sizeof(BOOK))
1515

1616
char SEE[sizeof(BOOK)] = {
1717
0,
@@ -66,17 +66,17 @@ int main() {
6666

6767
puts("#define __ae2f_MACRO_GENERATED\n\n");
6868
while ((c = fgetc(stdin)) != EOF) {
69-
if (c != 'a') {
69+
if (c != (BOOK)[0]) {
7070
l = fputc(c, stdout);
7171
if (l < 0)
7272
return 1;
7373
} else {
74-
SEE[0] = 'a';
74+
SEE[0] = (BOOK)[0];
7575
size_t i = 1;
7676
for (; i < SZBOOK; i++) {
7777
SEE[i] = fgetc(stdin);
7878

79-
if (SEE[i] != BOOK[i]) {
79+
if (SEE[i] != (BOOK)[i]) {
8080
SEE[i + 1] = 0;
8181
break;
8282
}

0 commit comments

Comments
 (0)