summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgryf <gryf73@gmail.com>2023-04-02 09:53:58 +0200
committergryf <gryf73@gmail.com>2023-04-02 09:53:58 +0200
commit1a21b9d42f221e3d05b950eb06b9ac3a06af474f (patch)
tree3a5ea4b919a16cf7039d9e9b5017ce128f4cfd3d
parenta60507c8dfb2f222e3d600d587f3d220a8de4b90 (diff)
downloadwmamixer-1a21b9d42f221e3d05b950eb06b9ac3a06af474f.tar.gz
wmamixer-1a21b9d42f221e3d05b950eb06b9ac3a06af474f.tar.bz2
wmamixer-1a21b9d42f221e3d05b950eb06b9ac3a06af474f.zip
Fix format-truncation warnings.
-rw-r--r--wmamixer.c8
-rw-r--r--wmamixer.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/wmamixer.c b/wmamixer.c
index 7e85437..d04d0c5 100644
--- a/wmamixer.c
+++ b/wmamixer.c
@@ -302,14 +302,14 @@ void Mixer_set_selem_props(struct Selem *selem, const char *name) {
}
}
-void Selem_set_name(struct Selem *selem, const char *name, short int *count) {
- char new_name[5], buf[5];
+void Selem_set_name(struct Selem *selem, const char *name, short unsigned int *count) {
+ char new_name[5], buf[4];
if (*count > 10) {
snprintf(new_name, sizeof(new_name), "%s", name);
} else {
- snprintf(buf, sizeof(buf) - 1, "%s", name);
- snprintf(new_name, sizeof(new_name), "%s%d", buf, *count);
+ snprintf(buf, sizeof(buf), "%s", name);
+ snprintf(new_name, sizeof(new_name), "%s%hu", buf, *count);
}
selem->name = strdup(new_name);
diff --git a/wmamixer.h b/wmamixer.h
index 73cfa0e..881856b 100644
--- a/wmamixer.h
+++ b/wmamixer.h
@@ -38,7 +38,7 @@
#define CLASS "Wmamixer"
-#define VERSION "1.0"
+#define VERSION "1.1"
// User defines - custom
#define BACKCOLOR "#202020"
@@ -142,7 +142,7 @@ typedef struct {
} slideCaptureMono;
struct NamesCount {
- short int pcm, line, lineb, mic, micb, capt, vol, aux;
+ short unsigned int pcm, line, lineb, mic, micb, capt, vol, aux;
} namesCount = {1, 1, 1, 1, 1, 1, 1, 1};
struct Selem *selems[32] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -194,7 +194,7 @@ void Mixer_set_right(int current, int value);
void Mixer_set_limits(snd_mixer_elem_t *elem, struct Selem *selem);
void Mixer_set_volume(int current, int channelIndex, int value);
-void Selem_set_name(struct Selem *selem, const char *name, short int *count);
+void Selem_set_name(struct Selem *selem, const char *name, short unsigned int *count);
void Selem_destroy();
#endif // WMAMIXER_H_