mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
cleanup: remove unnecessary string duplication
I don't understand why the functions must be called on a copy of the string. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
15bf145f14
commit
cf95c3bd82
1 changed files with 2 additions and 5 deletions
|
@ -90,7 +90,6 @@ int enumerate_devices(device_callback_t callback, void *userdata, unsigned int t
|
||||||
size_t i;
|
size_t i;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
char *fname;
|
|
||||||
size_t len;
|
size_t len;
|
||||||
if (transport & DC_TRANSPORT_SERIAL) {
|
if (transport & DC_TRANSPORT_SERIAL) {
|
||||||
const char *dirname = "/dev";
|
const char *dirname = "/dev";
|
||||||
|
@ -155,15 +154,13 @@ int enumerate_devices(device_callback_t callback, void *userdata, unsigned int t
|
||||||
end++;
|
end++;
|
||||||
|
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
fname = strdup(start);
|
|
||||||
|
|
||||||
callback(fname, userdata);
|
callback(start, userdata);
|
||||||
|
|
||||||
if (is_default_dive_computer_device(fname))
|
if (is_default_dive_computer_device(start))
|
||||||
index = entries;
|
index = entries;
|
||||||
entries++;
|
entries++;
|
||||||
num_uemis++;
|
num_uemis++;
|
||||||
free((void *)fname);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
|
|
Loading…
Reference in a new issue