kimtore / pms

Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.
https://ambientsound.github.io/pms/
MIT License
249 stars 23 forks source link

Fix infinite loop if run without a controlling terminal #119

Closed epakai closed 5 years ago

epakai commented 5 years ago

This loop has potential to run infinitely if fgets() errors instead of returning something. This can happen when pms is run from X without a terminal. This results in a lot of logging to .xsession-errors.

Instead I propose to just exit if a null pointer is returned. This still allows the prompt to repeat as long as fgets() doesn't error.

kimtore commented 5 years ago

Thank you @epakai.