diff options
author | Max Kellermann <max@duempel.org> | 2008-10-09 15:21:23 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-11 19:21:49 -0700 |
commit | d296861ea05101450b3f3147f6cfcd134486a384 (patch) | |
tree | 40950f6f678e35fadd044720215af182eacc4653 | |
parent | 064e2b83d8fb694813d451d667709dc1b33c2431 (diff) | |
download | mpd-d296861ea05101450b3f3147f6cfcd134486a384.tar.gz mpd-d296861ea05101450b3f3147f6cfcd134486a384.tar.xz mpd-d296861ea05101450b3f3147f6cfcd134486a384.zip |
database: removed local variable bufferSize
Use sizeof(buffer) instead.
-rw-r--r-- | src/database.c | 5 |
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) |