Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Rotor Control window displays with missing knob(s) and crashes when tracking.

未关闭 适合新手
#352 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1 小时以内
新手友好度
60/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
c
领域
desktop

调研方向

错误位于函数 gtk_rot_knob_update 中,其中局部缓冲区 b 的大小对于 g_ascii_formatd 的输出和数字标签循环来说太小。先比较缓冲区大小、传给 g_ascii_formatd 的格式宽度以及循环上界,然后检查标签索引是否仍与 knob->digits 对齐。完成的标准是:打开 Rotor Control 时显示 Az 和 El 旋钮,跟踪期间它们持续更新,且没有溢出。

由索引模型根据 Issue 内容生成。

描述

I am new to GPredict and wanted a new compile (post 3.2.37) in order to avoid wrap around tracking. I followed directions for installing MSYS2 and with only minor fussing was able to compile for windows. The program appears generally in good order (some config defaults seem off). The main issue is that when I open Rotor Control, the Az/El knobs don't show up (Az is always missing, El is usually missing). I've tracked this down to the length of the b[7] array definition, which I believe should be 8. Just to be extra safe I set it to b[9] (not familiar with g_ascii_formatd and termination etc.) and it appears to work as intended on initial opening and tracking updates.

static void gtk_rot_knob_update(GtkRotKnob * knob)
{
    gchar           b[7];  //<-------- Here
    gchar          *buff;
    guint           i;

    g_ascii_formatd(b, 8, "%6.2f", fabs(knob->value));

    /* set label markups */
    for (i = 0; i < 6; i++)
    {
        buff = g_strdup_printf(FMTSTR, b[i]);
        gtk_label_set_markup(GTK_LABEL(knob->digits[i + 1]), buff);
        g_free(buff);
    }

    if (knob->value < 0)
        buff = g_strdup_printf(FMTSTR, '-');
    else
        buff = g_strdup_printf(FMTSTR, ' ');

    gtk_label_set_markup(GTK_LABEL(knob->digits[0]), buff);
    g_free(buff);
}
主要语言
C
星标
1.2k
派生
305
平均合并
8 小时 48 分钟
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

csete/gpredict 的其他 Issue

查看 csete/gpredict 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。