Linuxで:
paleofetch.c: 関数 ‘get_colors2’ 内:
paleofetch.c:765:23: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^
paleofetch.c:765:37: 警告: ‘%d’ directive output may be truncated writing between 1 and 2 bytes into a region of size 1 [-Wformat-truncation=]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~
paleofetch.c:765:28: 備考: directive argument in the range [8, 15]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~~~~~~~~~~~~~~~
paleofetch.c:765:5: 備考: ‘snprintf’ output between 13 and 14 bytes into a destination of size 8
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Linuxで:
paleofetch.c: 関数 ‘get_colors2’ 内:
paleofetch.c:765:23: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^
paleofetch.c:765:37: 警告: ‘%d’ directive output may be truncated writing between 1 and 2 bytes into a region of size 1 [-Wformat-truncation=]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~
paleofetch.c:765:28: 備考: directive argument in the range [8, 15]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~~~~~~~~~~~~~~~
paleofetch.c:765:5: 備考: ‘snprintf’ output between 13 and 14 bytes into a destination of size 8
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paleofetch.c: 関数 ‘get_value’ 内:
paleofetch.c:812:27: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
812 | snprintf(buf, sizeof(buf), "%s=%s;", c.label, value);
| ^
paleofetch.c: 関数 ‘get_value’ 内:
paleofetch.c:812:27: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
812 | snprintf(buf, sizeof(buf), "%s=%s;", c.label, value);
| ^
paleofetch.c:752:23: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^
paleofetch.c:752:39: 警告: ‘snprintf’ output truncated before the last format character [-Wformat-truncation=]
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^
paleofetch.c:752:5: 備考: ‘snprintf’ output 9 bytes into a destination of size 8
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paleofetch.c:752:23: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^
paleofetch.c:752:39: 警告: ‘snprintf’ output truncated before the last format character [-Wformat-truncation=]
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^
paleofetch.c:752:5: 備考: ‘snprintf’ output 9 bytes into a destination of size 8
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paleofetch.c
@ -673,3 +763,3 @@
for (int i = 8; i < 16; i++) {
sprintf(s, "\e[48;5;%dm ", i);
snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
Linuxで:
paleofetch.c: 関数 ‘get_colors2’ 内:
paleofetch.c:765:23: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^
paleofetch.c:765:37: 警告: ‘%d’ directive output may be truncated writing between 1 and 2 bytes into a region of size 1 [-Wformat-truncation=]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~
paleofetch.c:765:28: 備考: directive argument in the range [8, 15]
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~~~~~~~~~~~~~~~
paleofetch.c:765:5: 備考: ‘snprintf’ output between 13 and 14 bytes into a destination of size 8
765 | snprintf(s, sizeof(s), "\e[48;5;%dm ", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -721,3 +811,2 @@
char *buf = malloc(BUF_SIZE);
sprintf(buf, "%s=%s;", c.label, value);
strcat(cache_data, buf);
snprintf(buf, sizeof(buf), "%s=%s;", c.label, value);
paleofetch.c: 関数 ‘get_value’ 内:
paleofetch.c:812:27: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
812 | snprintf(buf, sizeof(buf), "%s=%s;", c.label, value);
| ^
@ -660,3 +750,3 @@
for (int i = 0; i < 8; i++) {
sprintf(s, "\e[4%dm ", i);
snprintf(s, sizeof(s), "\e[4%dm ", i);
paleofetch.c:752:23: 警告: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^
paleofetch.c:752:39: 警告: ‘snprintf’ output truncated before the last format character [-Wformat-truncation=]
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^
paleofetch.c:752:5: 備考: ‘snprintf’ output 9 bytes into a destination of size 8
752 | snprintf(s, sizeof(s), "\e[4%dm ", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -380,2 +433,2 @@
strcat(command, wayland_wms[sizeof(wayland_wms) / sizeof(wayland_wms[0]) - 1]);
strcat(command, "'");
strncat(command, wayland_wms[sizeof(wayland_wms) / sizeof(wayland_wms[0]) - 1], sizeof(command));
strncat(command, "'", sizeof(command));
paleofetch.c: 関数 ‘get_wm’ 内:
paleofetch.c:431:7: 警告: ‘strncat’ specified bound 1024 equals destination size [-Wstringop-overflow=]
431 | strncat(command, "|", sizeof(command));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paleofetch.c:434:5: 警告: ‘strncat’ specified bound 1024 equals destination size [-Wstringop-overflow=]
434 | strncat(command, "'", sizeof(command));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paleofetch.c:433:5: 警告: ‘strncat’ specified bound 1024 equals destination size [-Wstringop-overflow=]
433 | strncat(command, wayland_wms[sizeof(wayland_wms) / sizeof(wayland_wms[0]) - 1], sizeof(command));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paleofetch.c:430:7: 警告: ‘strncat’ specified bound 1024 equals destination size [-Wstringop-truncation]
430 | strncat(command, wayland_wms[i], sizeof(command));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
paleofetch.c:430:7: 警告: ‘strncat’ specified bound 1024 equals destination size [-Wstringop-overflow=]
Linuxでのエラーを修正しました
ステップ 1:
あなたのプロジェクトリポジトリで新しいブランチをチェックアウトし、変更内容をテストします。ステップ 2:
変更内容をマージして、Giteaに反映します。