Skip to content

Commit

Permalink
- Remove valgrind warnings by making sure size!=dest in the memcpy us…
Browse files Browse the repository at this point in the history
…ed in simulation_events.cpp

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7452 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 17, 2010
1 parent f75b9c0 commit 4bfedf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c_runtime/simulation_events.cpp
Expand Up @@ -449,7 +449,7 @@ static int unique(void *base, size_t nmemb, size_t size, int(*compar)(const void
} else {
a = b;
c = ((char*)base)+(i-nuniq)*size;
memcpy(c, b, size);
if (b!=c) memcpy(c, b, size); // Happens when nuniq==0
}
}
return nmemb-nuniq;
Expand All @@ -466,7 +466,7 @@ static int filter_all_lesser(void *base, void *a, size_t nmemb, size_t size, int
nuniq++;
} else {
c = ((char*)base)+(i-nuniq)*size;
memcpy(c, b, size);
if (b!=c) memcpy(c, b, size); // Happens when nuniq==0
}
}
return nmemb-nuniq;
Expand Down

0 comments on commit 4bfedf1

Please sign in to comment.