Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audacious.cc: print_audacious_filename(): fix always empty $audacious_filename #2038

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

z1atk0
Copy link
Contributor

@z1atk0 z1atk0 commented Sep 20, 2024

print_audacious_filename() always returns an empty (zero-length) $audacious_filename, due to one of the std::min() operands always being 0. Removing the std::min() construct fixes the problem. Fixes #1175.

Checklist

  • [ ✔️ ] I have described the changes
  • [ ✔️ ] I have linked to any relevant GitHub issues, if applicable
  • [ ❌ ] Documentation in doc/ has been updated (N/A, I think 🤷‍♂️)
  • [ ✔️ ] All new code is licensed under GPLv3

Description

In print_audacious_filename(), obj->data.i is always 0 on my system (can't test anywhere else, I'm afraid), so std::min((unsigned int)obj->data.i, p_max_size) also evaluates to 0, resulting in a zero-length (ie. empty) string being returned for $audacious_filename, even though the correct, full filename is being received over DBus. Removing the std::min() construct fixes the problem, resulting in the correct value being assigned to $audacious_filename.

I first encountered this bug with conky-1.12.2, audaciuos-4.1, libaudclient-3.5-rc2, gcc-/g++-9.2.0 on 32bit Slackware-14.2 more then 2 years ago, and it's still present today with conky-1.21.7, audacious-4.3, libaudclient-3.5-rc2, gcc-/g++-11.2.0 on 64bit Slackware-15.0, so I doubt it's some sort of one-time "freak accident". 🙂

…_filename

print_audacious_filename() always returns an empty (zero-length) $audacious_filename, due to one of the std::min() operators always being 0. Removing the std::min() construct fixes the problem. Fixes brndnmtthws#1175.
@github-actions github-actions bot added sources PR modifies project sources audio Issue or PR related to audacious, pulseaudio, and other audio components labels Sep 20, 2024
Copy link

netlify bot commented Sep 20, 2024

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit 1a3a05b
🔍 Latest deploy log https://app.netlify.com/sites/conkyweb/deploys/66ed9a8124d7f70008f18cf0

@brndnmtthws brndnmtthws added the bug Bug report or bug fix PR label Sep 21, 2024
@brndnmtthws brndnmtthws merged commit 568d7e7 into brndnmtthws:main Sep 21, 2024
39 checks passed
@z1atk0 z1atk0 deleted the fix-audaciuos-filename branch September 21, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio Issue or PR related to audacious, pulseaudio, and other audio components bug Bug report or bug fix PR sources PR modifies project sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$audaciuos_filename is always empty
2 participants