aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-09 15:21:23 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:49 -0700
commitd296861ea05101450b3f3147f6cfcd134486a384 (patch)
tree40950f6f678e35fadd044720215af182eacc4653 /src
parent064e2b83d8fb694813d451d667709dc1b33c2431 (diff)
downloadmpd-d296861ea05101450b3f3147f6cfcd134486a384.tar.gz
mpd-d296861ea05101450b3f3147f6cfcd134486a384.tar.xz
mpd-d296861ea05101450b3f3147f6cfcd134486a384.zip
database: removed local variable bufferSize
Use sizeof(buffer) instead.
Diffstat (limited to '')
-rw-r--r--src/database.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c
index 0fc340c3b..6ed7a445d 100644
--- a/src/database.c
+++ b/src/database.c
@@ -232,7 +232,6 @@ int db_load(void)
char *dbFile = db_get_file();
struct stat st;
char buffer[100];
- int bufferSize = 100;
int foundFsCharset = 0;
int foundVersion = 0;
@@ -246,7 +245,7 @@ int db_load(void)
}
/* get initial info */
- if (!myFgets(buffer, bufferSize, fp))
+ if (!myFgets(buffer, sizeof(buffer), fp))
FATAL("Error reading db, fgets\n");
if (0 != strcmp(DIRECTORY_INFO_BEGIN, buffer)) {
@@ -256,7 +255,7 @@ int db_load(void)
return -1;
}
- while (myFgets(buffer, bufferSize, fp) &&
+ while (myFgets(buffer, sizeof(buffer), fp) &&
0 != strcmp(DIRECTORY_INFO_END, buffer)) {
if (!prefixcmp(buffer, DIRECTORY_MPD_VERSION)) {
if (foundVersion)