-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature 1855 sonarqube fix strlen & strcpy #1898
Changes from 23 commits
d7ca364
0d322f2
c099f60
868ab7d
30ce2e5
eafb807
ae6a6c2
e94048b
fb843da
56ec1bf
ee6e4c6
955a8ca
116c4e2
489923f
8b0a8cf
f691aa5
3de9c3d
7fb2ecd
d80307c
183f53f
7b1a64b
cf8ef98
5acda75
4b975a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -432,7 +432,7 @@ int do_id() | |||
|
||||
{ | ||||
|
||||
// column += strlen(yytext); | ||||
// column += m_strlen(yytext); | ||||
|
||||
if ( enum_mode || last_was_enum || last_was_class ) { | ||||
|
||||
|
@@ -456,7 +456,7 @@ int do_int() | |||
|
||||
{ | ||||
|
||||
// column += strlen(yytext); | ||||
// column += m_strlen(yytext); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Instead of editing commented out code, let's just remove it. |
||||
|
||||
if ( !enum_mode ) return ( 0 ); | ||||
|
||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -26,6 +26,7 @@ using namespace std; | |||
#include "math_constants.h" | ||||
#include "util_constants.h" | ||||
#include "is_number.h" | ||||
#include "string_fxns.h" | ||||
|
||||
#include "dictionary.h" | ||||
#include "builtin.h" | ||||
|
@@ -527,7 +528,7 @@ int do_id() | |||
|
||||
int j, k; | ||||
|
||||
Column += strlen(configtext); | ||||
Column += m_strlen(configtext); | ||||
|
||||
if ( is_lhs ) { strncpy(configlval.text, configtext, max_id_length); return ( IDENTIFIER ); } | ||||
|
||||
|
@@ -657,7 +658,7 @@ int do_int() | |||
|
||||
{ | ||||
|
||||
// Column += strlen(configtext); | ||||
// Column += m_strlen(configtext); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
||||
configlval.nval.i = atoi(configtext); | ||||
|
||||
|
@@ -678,7 +679,7 @@ bool do_float() | |||
|
||||
{ | ||||
|
||||
// Column += strlen(configtext); | ||||
// Column += m_strlen(configtext); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
||||
configlval.nval.d = atof(configtext); | ||||
|
||||
|
@@ -1113,7 +1114,7 @@ int do_comp() | |||
|
||||
int return_value = 0; | ||||
|
||||
Column += strlen(configtext); | ||||
Column += m_strlen(configtext); | ||||
|
||||
if ( strcmp(configtext, "<" ) == 0 ) { configlval.cval = thresh_lt; return_value = COMPARISON; } | ||||
else if ( strcmp(configtext, ">" ) == 0 ) { configlval.cval = thresh_gt; return_value = COMPARISON; } | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -730,7 +730,7 @@ for (j=0; j<N; ++j) { | |
// | ||
|
||
if ( (args[j].compare(verbosity_option) == 0) || | ||
(args[j].compare(log_option) == 0) ) continue; | ||
(args[j].compare(log_option) == 0) ) continue; | ||
|
||
option_index = options.lookup(args[j]); | ||
|
||
|
@@ -750,8 +750,6 @@ for (j=0; j<N; ++j) { | |
|
||
} | ||
|
||
return ( j ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know the logic here, but did you intend to remove this return? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The line 753 can not be executed because of the if statement above: continue or exit( 1 )
|
||
|
||
} | ||
|
||
} // for j | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of editing commented out code, let's just remove it.