Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
96eef094
Commit
96eef094
authored
Mar 26, 2005
by
rswindell
Browse files
Updated copyright date.
Using strdup() instead of malloc()/strcpy().
parent
5fc90a4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
src/xpdev/str_list.c
src/xpdev/str_list.c
+3
-7
src/xpdev/str_list.h
src/xpdev/str_list.h
+1
-1
No files found.
src/xpdev/str_list.c
View file @
96eef094
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
4
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
5
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
...
...
@@ -191,11 +191,9 @@ char* strListAppend(str_list_t* list, const char* str, size_t index)
if
(
str
==
NULL
)
return
(
NULL
);
if
((
buf
=
(
char
*
)
malloc
(
strlen
(
str
)
+
1
)
)
==
NULL
)
if
((
buf
=
strdup
(
str
))
==
NULL
)
return
(
NULL
);
strcpy
(
buf
,
str
);
if
(
index
==
STR_LIST_LAST_INDEX
)
index
=
strListCount
(
*
list
);
...
...
@@ -221,11 +219,9 @@ char* strListInsert(str_list_t* list, const char* str, size_t index)
if
(
str
==
NULL
)
return
(
NULL
);
if
((
buf
=
(
char
*
)
malloc
(
strlen
(
str
)
+
1
)
)
==
NULL
)
if
((
buf
=
strdup
(
str
))
==
NULL
)
return
(
NULL
);
strcpy
(
buf
,
str
);
return
(
str_list_insert
(
list
,
buf
,
index
));
}
...
...
src/xpdev/str_list.h
View file @
96eef094
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 200
4
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 200
5
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment