WIP: OpenBSD対応 #1

ドラフト
suwakoopenbsd から master への 3 コミットのマージを希望しています
オーナー
  • Makefile
  • paleofetch.h
  • config.h

paleofetch.c

  • #include
  • remove_newline(char *s)・truncate_spaces(char *str)・remove_substring(char str, const char substring, size_t len)・replace_substring(char *str, const char *sub_str, const char *repl_str, size_t sub_len, size_t repl_len)
  • *get_title()
  • *get_bar()
  • *get_os()
  • *get_kernel()
  • *get_host()
  • *get_uptime()
  • *get_packages()
  • *get_shell()
  • *get_resolution()
  • *get_wm()
  • get_terminal_x11(char *terminal)
  • *get_terminal()
  • *get_cpu()
  • *find_gpu()
  • *get_memory()
  • *get_colors1()・*get_colors2()
  • *spacer()・*get_cache_file()・*search_cache(char *cache_data, char *label)・*get_value(struct conf c, int read_cache, char *cache_data)
  • main(int argc, char *argv[])
* [x] Makefile * [x] paleofetch.h * [x] config.h # paleofetch.c * [x] #include * [x] remove_newline(char *s)・truncate_spaces(char *str)・remove_substring(char *str, const char* substring, size_t len)・replace_substring(char *str, const char *sub_str, const char *repl_str, size_t sub_len, size_t repl_len) * [x] *get_title() * [x] *get_bar() * [x] *get_os() * [x] *get_kernel() * [ ] *get_host() * [x] *get_uptime() * [x] *get_packages() * [x] *get_shell() * [ ] *get_resolution() * [x] *get_wm() * [x] get_terminal_x11(char *terminal) * [x] *get_terminal() * [ ] *get_cpu() * [ ] *find_gpu() * [ ] *get_memory() * [ ] *get_colors1()・*get_colors2() * [x] *spacer()・*get_cache_file()・*search_cache(char *cache_data, char *label)・*get_value(struct conf c, int read_cache, char *cache_data) * [x] main(int argc, char *argv[])
suwako が 1 コミット追加 2023-08-27 17:42:34 +09:00
suwako がレビュー 2023-08-27 17:50:36 +09:00
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);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
suwako がこの会話を解決済みにしました
suwako がレビュー 2023-08-27 17:51:01 +09:00
paleofetch.c 古い内容
@ -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);
| ^

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); | ^
suwako がこの会話を解決済みにしました
suwako がレビュー 2023-08-27 17:53:21 +09:00
paleofetch.c 古い内容
@ -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);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
suwako がこの会話を解決済みにしました
suwako がレビュー 2023-08-27 17:54:28 +09:00
paleofetch.c 古い内容
@ -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=]

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=]
suwako がこの会話を解決済みにしました
suwako が 1 コミット追加 2023-08-27 18:31:33 +09:00
作成者
オーナー

Linuxでのエラーを修正しました

Linuxでのエラーを修正しました
suwako が 1 コミット追加 2023-08-27 18:58:30 +09:00
このプルリクエストは作業中(WIP)としてマーキングされています。
コマンドラインの手順も確認できます。

ステップ 1:

あなたのプロジェクトリポジトリで新しいブランチをチェックアウトし、変更内容をテストします。
git checkout -b openbsd master
git pull origin openbsd

ステップ 2:

変更内容をマージして、Giteaに反映します。
git checkout master
git merge --no-ff openbsd
git push origin master
サインインしてこの会話に参加。
レビューアなし
ラベルなし
マイルストーンなし
プロジェクトなし
担当者なし
1 人の参加者
通知
期日
期日が正しくないか範囲を超えています。 'yyyy-mm-dd' の形式で入力してください。

期日は未設定です。

依存関係

依存関係が設定されていません。

リファレンス: suwako/paleofetch-mod#1
説明はありません。