Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void GetenvB(char *name, char *env, int len)
- {
- int ierr = 0, one = 1;
- C2F(getenvc)(&ierr,name,env,&len,&one);
- if (ierr == 0)
- {
- char *last = &env[len-1];
- while ( *last == ' ' ) { last = '\0' ; }
- last--;
- }
- ....
- }
- Most likely this is what should be written here: while ( *last == ' ' ) { *last++ = '\0' ; }
- This suspicious code was found in Scilab project by PVS-Studio static code analyzer.
- Warning message is:
- V527 It is odd that the '\0' value is assigned to 'char' type pointer. Probably meant: *last = '\0'. getenvb.c 24
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment