utils: use g_str_has_prefix() instead of prefixcmp()

Remove duplicated code from MPD.
This commit is contained in:
Max Kellermann
2008-10-28 20:33:56 +01:00
parent 4a71f66256
commit 016d996131
10 changed files with 28 additions and 35 deletions
+3 -1
View File
@@ -26,6 +26,8 @@
#include "../config.h"
#include <glib.h>
#ifdef HAVE_OSS
#include <sys/soundcard.h>
#endif
@@ -518,7 +520,7 @@ void read_sw_volume_state(FILE *fp)
if (volume_mixerType != VOLUME_MIXER_TYPE_SOFTWARE)
return;
while (myFgets(buf, sizeof(buf), fp)) {
if (prefixcmp(buf, SW_VOLUME_STATE))
if (!g_str_has_prefix(buf, SW_VOLUME_STATE))
continue;
sv = strtol(buf + strlen(SW_VOLUME_STATE), &end, 10);
if (mpd_likely(!*end))