Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

format.h doesn't handle `char*` correctly

Open
#32 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start by locating the implementation and tests for the format function, then reproduce the reported char* example. Done means the example produces "dolor sit lorem ipsum amet" correctly, or the source documents the required conversion if the behavior is intentionally unsupported.

Written by the indexing model from the issue text.

Description

char *foobar = "lorem ipsum";
format("dolor sit {1} amet", foobar);

Expected result:
"dolor sit lorem ipsum amet"

Actual result:
"dolor sit dolor sit amet amet"

When passing in a char*-type variable to format's varargs list, need to cast the variable to std::string or convert it to a std::string. Not doing so results in fmt variable (first arg) being read a second time as one of the vararg variables.

Not a major issue but this small wart can take people by surprise - if this is wontfix, may I recommend adding a comment in the source?

Dominant language
C++
Stars
7
Forks
30
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GothenburgBitFactory/libshared

All issues in GothenburgBitFactory/libshared

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.