Commit 3bdf1337 authored by Claes Sjofors's avatar Claes Sjofors

Valgrind fixes

parent e1740e85
......@@ -3699,7 +3699,7 @@ static int ccm_read_file(
{
row++;
ccm_remove_blank( str, str);
if ( str[0] == '!' || (str[0] == '#' && strncmp( str, "#include", 8) != 0))
if ( str[0] == '!' || str[0] == 0 || (str[0] == '#' && strncmp( str, "#include", 8) != 0))
continue;
/* If last char i backslash, concatenate next line */
while( str[strlen(str)-1] == '\\')
......
......@@ -2611,12 +2611,12 @@ char *cdh_Strncpy( char *dest, const char *src, size_t n)
int cdh_StrncpyCutOff( char *t, const char *s, size_t n, int cutleft)
{
if ( strlen(s) < n) {
strcpy( t, s);
cdh_Strcpy( t, s);
return 0;
}
if ( cutleft) {
strcpy( t, s + strlen(s) - n + 1);
cdh_Strcpy( t, s + strlen(s) - n + 1);
if ( n > 5) {
t[0] = '.';
t[1] = '.';
......@@ -2624,7 +2624,7 @@ int cdh_StrncpyCutOff( char *t, const char *s, size_t n, int cutleft)
}
}
else {
strncpy( t, s, n);
cdh_Strncpy( t, s, n);
t[n-1] = 0;
if ( n > 5) {
t[n-2] = '.';
......
......@@ -151,7 +151,7 @@ static int nav_remove_spaces(
for ( s = in; !((*s == 0) || ((*s != ' ') && (*s != 9))); s++);
strcpy( out, s);
cdh_Strcpy( out, s);
if ( strlen(s) != 0)
{
......
......@@ -812,6 +812,9 @@ int FlowCtx::event_handler( flow_eEvent event, int x, int y, int w, int h)
FlowCtx *ctx;
int node_move_event = 0;
if ( event < flow_eEvent_Null || event >= flow_eEvent__)
return 0;
ctx = this;
// cout << "Event: " << event << endl;
......
......@@ -933,6 +933,9 @@ int GlowCtx::event_handler( glow_eEvent event, int x, int y, int w, int h)
GlowCtx *ctx;
int node_move_event = 0;
if ( event < glow_eEvent_Null || event >= glow_eEvent__)
return 0;
if ( ctx_type == glow_eCtxType_Grow || ctx_type == glow_eCtxType_Curve)
return ((GrowCtx *)this)->event_handler( event, x, y, w, h);
else if ( ctx_type == glow_eCtxType_ColPal)
......
......@@ -1580,7 +1580,7 @@ int ItemMenu::open_children( XNavBrow *brow, double x, double y)
if ( !brow_IsOpen( node))
action_open = 1;
}
if ( action_open || is_root)
if ( is_root || action_open)
{
// Display childlist
Item *item;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment