Id3ren create question

Howdy!

I encountered two warnings during the make process. Are these warnings detrimental to using the application?

Here is the output:

~> cd /boot/home/Development/id3ren-master
~/Development/id3ren-master> make install
make -C src install
make[1]: Entering directory ‘/boot/home/Development/id3ren-master/src’
gcc -s -O2 -Wall -o id3ren id3ren.c id3tag.c id3file.c id3misc.c
id3ren.c: In function ‘main’:
id3ren.c:833:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncpy(program_path, argv[0], ((strlen(argv[0]) - strlen(p)) - 1));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
id3ren.c:833:38: note: length computed here
strncpy(program_path, argv[0], ((strlen(argv[0]) - strlen(p)) - 1));
^~~~~~~~~~~~~~~
id3misc.c: In function ‘print_error’:
id3misc.c:125:23: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 1022 [-Wformat-overflow=]
sprintf(buf, “%s: %s: %s\n”, program_name, buf, strerror(errno));
^~ ~~~
id3misc.c:125:5: note: ‘sprintf’ output 6 or more bytes (assuming 1029) into a destination of size 1024
sprintf(buf, “%s: %s: %s\n”, program_name, buf, strerror(errno));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
install -D -s -m 755 id3ren /usr/bin/id3ren
install: cannot create regular file ‘/usr/bin/id3ren’: Invalid Argument
Makefile:23: recipe for target ‘install’ failed
make[1]: *** [install] Error 1
make[1]: Leaving directory ‘/boot/home/Development/id3ren-master/src’
Makefile:8: recipe for target ‘install’ failed
make: *** [install] Error 2

I know the fatal errors near the end is due to new virtual directory hierarchy in Haiku. No problem since the new application was in the ‘src’ directory.

I executed the new application and it seems to be working where I added new ID3 tags to four audio files. I confirmed and verified the tags were updated into the audio files.

Not sure what these warning are about. Can one of the developers explain what I am seeing in this output?

Thanks in advance!

It’s warnings from gcc about code in id3ren, about possible misuse of string manipulation APIs that oculd result in overflows in some cases. If the program is working fine, you can ignore those.

1 Like

Awesome! Thanks!