From bce4c3aa7454680edc3866f63b299e52ae59e4ff Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 23 Mar 2009 07:53:09 +0000 Subject: [PATCH] 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 --- camlibs/digita/digita.c | 8 ++------ 1 file 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;