Skip to content

fix(ppc/udev): memset 'name' -> 'path' so cpufetch builds on ppc64le - #408

Closed
MukundaKatta wants to merge 1 commit into
Dr-Noob:masterfrom
MukundaKatta:codex/fix-ppc-udev-memset-name-typo
Closed

fix(ppc/udev): memset 'name' -> 'path' so cpufetch builds on ppc64le#408
MukundaKatta wants to merge 1 commit into
Dr-Noob:masterfrom
MukundaKatta:codex/fix-ppc-udev-memset-name-typo

Conversation

@MukundaKatta

Copy link
Copy Markdown

Summary

`fill_array_from_sys` in `src/ppc/udev.c` declares `char path[128];` but calls `memset(name, 0, sizeof(char) * 128);`. `name` isn't declared in that scope, so the file fails to compile on a strict toolchain (clang on ppc64le / Chimera Linux, per #403):

```
src/ppc/udev.c:16:10: error: use of undeclared identifier 'name'
```

Changed the `memset` target to the actually-declared `path` buffer, which is also what `sprintf(path, ...)` writes to on the next line. Used `sizeof(path)` for symmetry with the declared size.

Closes #403

Testing

Confirmed via grep that `name` is not declared anywhere else in the file. Did not have a ppc64le toolchain locally to run a full build — would be great if a maintainer with ppc access confirms the build now passes.

fill_array_from_sys declares 'char path[128];' but then called
'memset(name, 0, sizeof(char) * 128);'. 'name' is not declared in that
scope, so clang fails with:

    src/ppc/udev.c:16:10: error: use of undeclared identifier 'name'

Change the memset to zero 'path', which matches the buffer actually
used on the next line (sprintf(path, ...)).

Closes Dr-Noob#403
@github-actions

Copy link
Copy Markdown

cpufetch does not accept pull requests, see the contributing guidelines for details

@github-actions github-actions Bot closed this Apr 21, 2026
@MukundaKatta

Copy link
Copy Markdown
Author

Withdrawing — low-value drive-by change. Apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cpufetch 1.07 fails to build on ppc64le due to a typo in src/ppc/udev.c.

1 participant