[Liblas-commits] hg: clean up strdup warnings by using LASCopyString
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Aug 26 15:39:53 EDT 2010
changeset 30d7b8e1bb8f in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=30d7b8e1bb8f
summary: clean up strdup warnings by using LASCopyString
diffstat:
apps/las2txt.c | 2 +-
apps/lasmerge.c | 2 +-
apps/txt2las.c | 6 ++++--
3 files changed, 6 insertions(+), 4 deletions(-)
diffs (54 lines):
diff -r a9c19590b2aa -r 30d7b8e1bb8f apps/las2txt.c
--- a/apps/las2txt.c Thu Aug 26 14:30:54 2010 -0500
+++ b/apps/las2txt.c Thu Aug 26 13:39:36 2010 -0600
@@ -316,7 +316,7 @@
}
len = (int)strlen(file_name_in);
- file_name_out = strdup(file_name_in);
+ file_name_out = LASCopyString(file_name_in);
if (file_name_out[len-3] == '.' && file_name_out[len-2] == 'g' && file_name_out[len-1] == 'z')
{
len = len - 4;
diff -r a9c19590b2aa -r 30d7b8e1bb8f apps/lasmerge.c
--- a/apps/lasmerge.c Thu Aug 26 14:30:54 2010 -0500
+++ b/apps/lasmerge.c Thu Aug 26 13:39:36 2010 -0600
@@ -233,7 +233,7 @@
alloced_file_name_in *= 2;
file_names_in = (char**)realloc(file_names_in,sizeof(char*)*alloced_file_name_in);
}
- file_names_in[num_file_name_in] = strdup(line);
+ file_names_in[num_file_name_in] = LASCopyString(line);
i = (int)strlen(file_names_in[num_file_name_in]) - 1;
while ( i &&
file_names_in[num_file_name_in][i] != 's' &&
diff -r a9c19590b2aa -r 30d7b8e1bb8f apps/txt2las.c
--- a/apps/txt2las.c Thu Aug 26 14:30:54 2010 -0500
+++ b/apps/txt2las.c Thu Aug 26 13:39:36 2010 -0600
@@ -20,6 +20,8 @@
#define LAS_FORMAT_11 1
#define LAS_FORMAT_12 2
+
+
void usage()
{
@@ -536,7 +538,7 @@
if (file_name_out == NULL && file_name_in != NULL)
{
int len = (int)strlen(file_name_in);
- file_name_out = strdup(file_name_in);
+ file_name_out = LASCopyString(file_name_in);
while (len > 0 && file_name_out[len] != '.')
{
@@ -567,7 +569,7 @@
}
/* create a cheaper parse string that only looks for 'x' 'y' 'z' and 'r' */
- parse_less = strdup(parse_string);
+ parse_less = LASCopyString(parse_string);
for (i = 0; i < (int)strlen(parse_string); i++)
{
if (parse_less[i] != 'x' &&
More information about the Liblas-commits
mailing list