diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2009-03-23 07:53:09 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2009-03-23 07:53:09 +0000 |
commit | bce4c3aa7454680edc3866f63b299e52ae59e4ff (patch) | |
tree | 7ecebacdd9b4a26f1013df9e6fac06fd5c62fe04 /camlibs/digita | |
parent | bf734919c55af20889858ecb700bc4c0fab5e7c2 (diff) | |
download | libgphoto2-bce4c3aa7454680edc3866f63b299e52ae59e4ff.tar.gz |
removed tmppath usage, we just strcmp path here anyway,
no need to truncate.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11889 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/digita')
-rw-r--r-- | camlibs/digita/digita.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/camlibs/digita/digita.c b/camlibs/digita/digita.c index 2850f87d1..243d966b6 100644 --- a/camlibs/digita/digita.c +++ b/camlibs/digita/digita.c @@ -138,7 +138,6 @@ static int folder_list_func(CameraFilesystem *fs, const char *folder, /* Walk through all of the pictures building a list of folders */ for (i = 0; i < camera->pl->num_pictures; i++) { int found; - char tmppath[PATH_MAX + 1]; char *path; /* Check to make sure the path matches the folder we're */ @@ -159,22 +158,19 @@ static int folder_list_func(CameraFilesystem *fs, const char *folder, if (strchr(path, '/') != path + strlen(path) - 1) continue; - strncpy(tmppath, path, MIN(strlen(path) - 1, PATH_MAX)); - tmppath[strlen(path) - 1] = 0; - found = 0; for (i1 = 0; i1 < gp_list_count(list); i1++) { const char *name; gp_list_get_name(list, i1, &name); - if (!strcmp(name, tmppath)) { + if (!strcmp(name, path)) { found = 1; break; } } if (!found) - gp_list_append(list, tmppath, NULL); + gp_list_append(list, path, NULL); } return GP_OK; |