summaryrefslogtreecommitdiff
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
parentdbce22dc68cffc8315a8dc8e999d69dcb5ad9c44 (diff)
downloadrockbox-2cab3116356e377fe0c3073ce679b69478553565.tar.gz
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
-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 @@
1/* A _very_ skeleton file to demonstrate building tagcache db on host. */ 1/* A _very_ skeleton file to demonstrate building tagcache db on host. */
2 2
3#include <stdio.h> 3#include <stdio.h>
4#include <sys/stat.h>
4#include "tagcache.h" 5#include "tagcache.h"
5 6
6int main(int argc, char **argv) 7int main(int argc, char **argv)
@@ -15,7 +16,8 @@ int main(int argc, char **argv)
15/* stub to avoid including all of apps/misc.c */ 16/* stub to avoid including all of apps/misc.c */
16bool file_exists(const char *file) 17bool file_exists(const char *file)
17{ 18{
18 if (!stat(file)) 19 struct stat s;
20 if (!stat(file, &s))
19 return true; 21 return true;
20 return false; 22 return false;
21} 23}