# Echo test failing, unable to reproduce failure locally

**URL:** <https://forum.codecrafters.io/t/echo-test-failing-unable-to-reproduce-failure-locally/4048>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [January 8, 2025, 9:21am UTC](https://forum.codecrafters.io/t/echo-test-failing-unable-to-reproduce-failure-locally/4048 "2025-01-08T09:21:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![security-man](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/security-man/32/4092_2.png) [@security-man](https://forum.codecrafters.io/u/security-man)\
**Post date:** [January 8, 2025, 9:21am UTC](https://forum.codecrafters.io/t/echo-test-failing-unable-to-reproduce-failure-locally/4048/1 "2025-01-08T09:21:12Z")

</div>

Hi all,

I’m having some trouble with the ‘Single quotes’ stage of the shell challenge (in C). I am receiving build failed messages (screenshot below). However, all my local testing and attempts to reproduce the issue (I’ve tried multiple repeat submissions with different input text, all failing for the same reason):

(Remote test fail on left, successful local result on right):

 ![Screenshot 2025-01-08 at 09.20.24](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/5/5799fb9616a1d9b331a1066cf20c48308dcacc3b.png)

Is there something obvious I’m missing when I attempt to reproduce locally?

Thanks,

Zac

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [January 8, 2025, 10:17am UTC](https://forum.codecrafters.io/t/echo-test-failing-unable-to-reproduce-failure-locally/4048/3 "2025-01-08T10:17:00Z")

</div>

Hi @security-man, the test failed due to extra single quotes in the output:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/8/8d373b5a18f072027b7f55fc4b78c892c4d1f325.jpeg)

The issue might be caused by this:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/0/077fa46f9fccef484564841d5e77e5d1d910d895.png)

Since `strcmp` expects a null-terminated string, using a buffer with only 1 byte allocated might cause unexpected behaviors. There needs to be enough space for both the character and the null terminator.

---

<div class="post-metadata">

**Author:** ![security-man](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/security-man/32/4092_2.png) [@security-man](https://forum.codecrafters.io/u/security-man)\
**Post date:** [January 8, 2025, 10:29am UTC](https://forum.codecrafters.io/t/echo-test-failing-unable-to-reproduce-failure-locally/4048/5 "2025-01-08T10:29:56Z")

</div>

Hi @andy1li - thank you so much for your prompt reply! I will investigate further and make the necessary changes to see if that resolves things, thank you.

---

<div class="post-metadata">

**Author:** ![security-man](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/security-man/32/4092_2.png) [@security-man](https://forum.codecrafters.io/u/security-man)\
**Post date:** [January 8, 2025, 10:43am UTC](https://forum.codecrafters.io/t/echo-test-failing-unable-to-reproduce-failure-locally/4048/6 "2025-01-08T10:43:43Z")

</div>

That worked a treat - now to fix the ‘cat’ portion of the submission!

Thanks again 🙂

---

<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:** [January 13, 2025, 10:43am UTC](https://forum.codecrafters.io/t/echo-test-failing-unable-to-reproduce-failure-locally/4048/7 "2025-01-13T10:43:58Z")

</div>

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