summaryrefslogtreecommitdiffstats
path: root/tools/database
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2009-08-06 18:28:38 +0000
committerNils Wallménius <nils@rockbox.org>2009-08-06 18:28:38 +0000
commit2cab3116356e377fe0c3073ce679b69478553565 (patch)
tree61233df1a732a4f062f5ac71b4d47739bb70b13b /tools/database
parentdbce22dc68cffc8315a8dc8e999d69dcb5ad9c44 (diff)
downloadrockbox-2cab3116356e377fe0c3073ce679b69478553565.tar.gz
rockbox-2cab3116356e377fe0c3073ce679b69478553565.tar.bz2
rockbox-2cab3116356e377fe0c3073ce679b69478553565.zip
Fix crash in the database utility, turns out passing too few arguments for stat() isn't the best idea :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22190 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/database')
-rw-r--r--tools/database/database.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/database/database.c b/tools/database/database.c
index a8be48ab4b..1f398c02f0 100644
--- a/tools/database/database.c
+++ b/tools/database/database.c
@@ -1,6 +1,7 @@
/* A _very_ skeleton file to demonstrate building tagcache db on host. */
#include <stdio.h>
+#include <sys/stat.h>
#include "tagcache.h"
int main(int argc, char **argv)
@@ -15,7 +16,8 @@ int main(int argc, char **argv)
/* stub to avoid including all of apps/misc.c */
bool file_exists(const char *file)
{
- if (!stat(file))
+ struct stat s;
+ if (!stat(file, &s))
return true;
return false;
}