# \[C, shell, IP1\] Empty line appears out of nowhere

**URL:** <https://forum.codecrafters.io/t/c-shell-ip1-empty-line-appears-out-of-nowhere/16264>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [September 4, 2026, 8:10pm UTC](https://forum.codecrafters.io/t/c-shell-ip1-empty-line-appears-out-of-nowhere/16264 "2026-09-04T20:10:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zergitscher](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/zergitscher/32/28485_2.png) [@zergitscher](https://forum.codecrafters.io/u/zergitscher)\
**Post date:** [September 4, 2026, 8:10pm UTC](https://forum.codecrafters.io/t/c-shell-ip1-empty-line-appears-out-of-nowhere/16264/1 "2026-09-04T20:10:15Z")

</div>

Hello. I’d like help with the stage in the title. I get an empty line that fails the test. I’m pretty sure I don’t print it and to confirm I copied someone else’s function, namely [jolly-donkey-889683/src at main · cc-code-examples/jolly-donkey-889683 · GitHub](https://github.com/cc-code-examples/jolly-donkey-889683/tree/main/src) . With `execute_external` from there, the same thing happens, but with that guy’s entire solution, it passes. Now, this might mean something in the rest of my code is wrong, but the empty line happens during the execution of the test program, so I don’t see how that could make a difference. It looks paradoxical to me. Maybe the test program does something unexpected between printing the arguments and signature?

Here are my logs:

```auto
[your-program] $ custom_exe_1976 David David James
[your-program] Program was passed 4 args (including program name).
[your-program] Arg #0 (program name): custom_exe_1976
[your-program] Arg #1: David
[your-program] Arg #2: David
[your-program] Arg #3: James
[your-program]
[tester::#IP1] ^ Line does not match expected value.
[tester::#IP1] Expected: "Program Signature: 4611262564"
[tester::#IP1] Received: "" (empty line)
[your-program] Program Signature: 4611262564
[your-program] $
[tester::#IP1] Test failed

```

“My” code is in [GitHub - zergitscher/codecrafters-shell-c · GitHub](https://github.com/zergitscher/codecrafters-shell-c) . I checked all prints, but I don’t think they print the empty line.

Maybe this is a duplicate of another topic, but that one wasn’t solved. I can’t post the link because only two links are allowed.

---

<div class="post-metadata">

**Author:** ![yeswanth](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/yeswanth/32/27558_2.png) [@yeswanth](https://forum.codecrafters.io/u/yeswanth)\
**Post date:** [September 8, 2026, 1:07pm UTC](https://forum.codecrafters.io/t/c-shell-ip1-empty-line-appears-out-of-nowhere/16264/3 "2026-09-08T13:07:13Z")

</div>

Hey @zergitscher

You can process the input after your `fgets` to remove any extra newline characters.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [September 13, 2026, 1:07pm UTC](https://forum.codecrafters.io/t/c-shell-ip1-empty-line-appears-out-of-nowhere/16264/4 "2026-09-13T13:07:17Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
