"format not a string literal and no format arguments"

Bug reports and discussion about bugs.
Post Reply
Dr. λ
Posts: 12
Joined: Mon Oct 28, 2019 10:12 pm

"format not a string literal and no format arguments"

Post by Dr. λ »

The file account/accedit.c in the source contains the lines such as

Code: Select all

	mvprintw(LINES - 1, 0, info);

Code: Select all

	mvprintw(LINES - 1, 0, prompt);
These lines cause compilation of TomeNET-4.8.0 to fail with the error "format not a string literal and no format arguments" when trying to compile on 32-bit NixOS.

I found a solution at https://stackoverflow.com/questions/441 ... 47#4419347 where someone says
To avoid the warning and possible attack vectors you can also use printf("%s", str);.
Doing a similar rewrite for the mvprintw calls indeed solves the problem.

TomeNET compiles and works for me now, but I thought this may be worth repairing upstream.
mikaelh
Developer
Posts: 216
Joined: Sun Dec 13, 2009 3:18 pm

Re: "format not a string literal and no format arguments"

Post by mikaelh »

It's fixed now in the git repo. Thanks for pointing it out.

https://github.com/TomenetGame/tomenet/ ... d6d2df0894
Post Reply