# \[C\]\[The pwd builtin #EI0\] issues on the tests

**URL:** <https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [May 15, 2025, 3:42am UTC](https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545 "2025-05-15T03:42:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvivallos](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/jvivallos/32/9282_2.png) [@jvivallos](https://forum.codecrafters.io/u/jvivallos)\
**Post date:** [May 15, 2025, 3:42am UTC](https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545/1 "2025-05-15T03:42:39Z")

</div>

I get a weird character at the end on my test run, so I’m getting the following error

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

Is this on purpose and I should detect extraneous characters or is there something else?

---

<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:** [May 15, 2025, 4:27am UTC](https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545/3 "2025-05-15T04:27:54Z")

</div>

Hey @jvivallos, could you [upload your code to GitHub](https://docs.codecrafters.io/features/publish-to-github) and share the link? It will be much easier to debug if I can run it directly.

---

<div class="post-metadata">

**Author:** ![jvivallos](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/jvivallos/32/9282_2.png) [@jvivallos](https://forum.codecrafters.io/u/jvivallos)\
**Post date:** [May 15, 2025, 10:33pm UTC](https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545/4 "2025-05-15T22:33:28Z")

</div>

Hey @andy1li, here’s my repo url [GitHub - jvivallos/codecrafters-shell-c at master](https://github.com/jvivallos/codecrafters-shell-c/tree/master)

---

<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:** [May 16, 2025, 2:06am UTC](https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545/6 "2025-05-16T02:06:21Z")

</div>

@jvivallos It looks like the issue is here:

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

The last byte of `external_command` is uninitialized, so null-termination with **\0** is not guaranteed.

---

<div class="post-metadata">

**Author:** ![jvivallos](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/jvivallos/32/9282_2.png) [@jvivallos](https://forum.codecrafters.io/u/jvivallos)\
**Post date:** [May 17, 2025, 3:00am UTC](https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545/8 "2025-05-17T03:00:50Z")

</div>

Yes! that did the trick!. Thank you for time @andy1li

---

<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:** [May 25, 2025, 7:27am UTC](https://forum.codecrafters.io/t/c-the-pwd-builtin-ei0-issues-on-the-tests/10545/9 "2025-05-25T07:27:05Z")

</div>

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