Skip to content

Commit

Permalink
[ruby/date] Enclose dangling else in braces and fix -Wmisleading-inde…
Browse files Browse the repository at this point in the history
…ntation

```
date_strptime.c:253:324: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
  253 |   ...((VALUE)RUBY_Qtrue)); return 0; } while (0); si += l; } while (0);
      |                                                   ^
date_strptime.c:252:7: note: previous statement is here
  252 |       else
      |       ^
```

ruby/date@41aed5b746
  • Loading branch information
nobu authored and matzbot committed Jan 13, 2025
1 parent 691c895 commit 384e694
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/date/date_strptime.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ do { \
do { \
size_t l; \
l = read_digits(&str[si], slen - si, &n, w); \
if (l == 0) \
if (l == 0) { \
fail(); \
} \
si += l; \
} while (0)

Expand Down

0 comments on commit 384e694

Please sign in to comment.