Commit a6e59e8
committed
Fix incorrect argument in 'do_size' error message
Previously, the error message in 'do_size' referenced 'argv[2]' instead
of 'argv[1]'. Since 'argc' is at most 2 in this context, 'argv[2]' is
always null, as defined in Section 5.1.2.2.1 of the C11 standard. While
GCC prints "(null)" for a null pointer in '%s' formatting, this behavior
is implementation-defined. Other compilers may cause undefined behavior,
potentially leading to a segmentation fault.
This change ensures the correct argument is used, avoiding reliance on
implementation-specific behavior and preventing potential crashes.
Change-Id: I27748efd7c3d533659a6eda78f7c68ced2e783661 parent 122aea9 commit a6e59e8
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
547 | | - | |
| 547 | + | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| |||
0 commit comments