aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-09 15:21:23 +0200
committerMax Kellermann <max@duempel.org>2008-10-09 15:21:23 +0200
commitcb12eb8e231cb653ea0f7f96d3de7cdf9e504f8c (patch)
treecb77d0612ba2ecc8e7df618616094cf20c7fbb0e
parent5dc4c325aaa90f7f5b5c3862d2f4076017a36dbf (diff)
downloadmpd-cb12eb8e231cb653ea0f7f96d3de7cdf9e504f8c.tar.gz
mpd-cb12eb8e231cb653ea0f7f96d3de7cdf9e504f8c.tar.xz
mpd-cb12eb8e231cb653ea0f7f96d3de7cdf9e504f8c.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 2b0a6abea..539396c41 100644
--- a/src/database.c
+++ b/src/database.c
@@ -239,7 +239,6 @@ db_load(void)
char *dbFile = db_get_file();
struct stat st;
char buffer[100];
- int bufferSize = 100;
int foundFsCharset = 0;
int foundVersion = 0;
@@ -253,7 +252,7 @@ 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)) {
@@ -263,7 +262,7 @@ 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)