scripts/mod/sumversion.c: replace strtok() with strsep()
PATCH 12/12 scripts/mod/sumversion.c: replace strtok() with strsep()
Replaces strtok() with strsep()
---
kj-domen/scripts/mod/sumversion.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-)
scripts/mod/sumversion.c renamed from scripts/mod/sumversion.c~strtok-scripts_mod_sumversion +3 -1
@@ -419,7 +419,9 @@ void get_src_version(const char *modname *end ='\0' ;md4_init (&md); -for (fname =strtok (sources," " ); fname; fname =strtok (NULL ," " )) { +while ((fname =strsep (&sources," " )) !=NULL ) { +if (!*fname) +continue ;if (!parse_source_files (fname, &md)) goto release; }
_
Quoted 2 lines · On Sat, Mar 05, 2005 at 04:35:45PM +0100, [email protected] wrote:
Replaces
strtok()withstrsep()
Why - does it increase portability?
Sam
* Sam Ravnborg <[email protected]>:
Quoted 5 lines · On Sat, Mar 05, 2005 at 04:35:45PM +0100, [email protected] wrote:
Quoted 2 lines
Replaces
strtok()withstrsep()Why - does it increase portability?
"strtok() is not thread and SMP safe and strsep() should be
used instead"
http://janitor.kernelnewbies.org/docs/driver-howto.html#3.3.1
Cheers,
n.
Quoted 4 lines · Nicolas Kaiser
* Sam Ravnborg <[email protected]>:
Quoted 2 lines · On Sat, Mar 05, 2005 at 04:35:45PM +0100, [email protected] wrote:
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Replaces
strtok()withstrsep()Why - does it increase portability?
"
strtok()is not thread and SMP safe andstrsep()should be
used instead"http://janitor.kernelnewbies.org/docs/driver-howto.html#3.3.1
It does not matter in this particular file.
But applied for consistency (so it does not show up if you grep for it).
Sam