FDD-book/content/chapters/part1
Edson Brandi be78fa799d Fix null terminator demonstration to show undefined behavior
The previous example wasn't reliably demonstrating the danger of missing
null terminators because the stack happened to contain a '\0' byte
immediately after the array, making the broken code appear to work.

Added memset() to fill the stack with non-zero values before declaring
the unterminated array. This ensures the broken example actually exhibits
undefined behavior by reading past the array boundary, making the lesson
about null terminators clear and visible.

Changes:
- Added garbage array filled with 'Z' characters using memset()
- This forces printf() to read past the broken array until finding '\0'
- Readers now see actual garbage output demonstrating why null
  terminators are required in C strings
2025-11-07 22:57:09 +00:00
..
chapter-01.md Fixing markdown to convert to pdf 2025-08-30 22:30:50 +01:00
chapter-02.md Fixing markdown to convert to pdf 2025-08-30 22:30:50 +01:00
chapter-03.md Fix subshell variable scope issue in file counting scripts 2025-11-07 21:53:51 +00:00
chapter-04.md Fix null terminator demonstration to show undefined behavior 2025-11-07 22:57:09 +00:00
chapter-05.md Fixed markdown issue that was generating error in pdf conversion, i missed some lines in the previous commit 2025-10-27 20:49:34 +00:00
chapter-06.md Specify FreeBSD 14.3 release branch in git clone commands 2025-11-07 22:17:40 +00:00