// in case someone has combined a prefix with a core-specific option,
// eg. "--memcheck:verbose".
if (*colon == ':') {
- if (VG_STREQN(2, arg, "--") &&
- VG_STREQN(toolname_len, arg+2, VG_(clo_toolname)) &&
- VG_STREQN(1, arg+2+toolname_len, ":")) {
+ if (VG_STREQN(2, arg, "--") &&
+ VG_(strncmp)(arg+2, VG_(clo_toolname), toolname_len)==0 &&
+ VG_(strncmp)(arg+2+toolname_len, ":", 1)==0) {
// Prefix matches, convert "--toolname:foo" to "--foo".
// Two things to note:
// - We cannot modify the option in-place. If we did, and then
/* Opening /proc/<pid>/auxv or /proc/self/auxv? */
VG_(sprintf)(name, "/proc/%d/auxv", VG_(getpid)());
- if (!VG_STREQ(filename, name) && !VG_STREQ(filename, "/proc/self/auxv"))
+ if ((VG_(strcmp)(filename, name)!=0) && !VG_STREQ(filename, "/proc/self/auxv"))
return False;
/* Allow to open the file only for reading. */
/* Opening /proc/<pid>/exe or /proc/self/exe? */
VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)());
- if (!VG_STREQ(filename, name) && !VG_STREQ(filename, "/proc/self/exe"))
+ if ((VG_(strcmp)(filename, name)!=0) && !VG_STREQ(filename, "/proc/self/exe"))
return False;
/* Allow to open the file only for reading. */
VG_(sprintf)(name, "/proc/%d/cmdline", VG_(getpid)());
if (ML_(safe_to_deref)( arg1s, 1 )
- && (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, "/proc/self/cmdline"))) {
+ && (VG_(strcmp)(arg1s, name)==0 || VG_STREQ(arg1s, "/proc/self/cmdline"))) {
sres = VG_(dup)( VG_(cl_cmdline_fd) );
SET_STATUS_from_SysRes( sres );
if (!sr_isError(sres)) {
HChar* arg1s = (HChar*) (Addr)ARG1;
VG_(sprintf)(name, PID_EXEPATH, VG_(getpid)());
if (ML_(safe_to_deref)(arg1s, 1)
- && (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, SELF_EXEPATH))) {
+ && (VG_(strcmp)(arg1s, name)==0 || VG_STREQ(arg1s, SELF_EXEPATH))) {
HChar* out_name = (HChar*)ARG2;
SizeT res = VG_(strlen)(VG_(resolved_exename));
res = VG_MIN(res, ARG3);
HChar buf[3] = {0,0,0};
Int fd = sr_Res(res);
Int n = VG_(read)(fd, buf, 2);
- if (n == 2 && VG_STREQ("#!", buf))
+ if (n == 2 && (VG_(strcmp)(buf, "#!")==0))
return True;
}
return False;
tl_assert(old_te->u.remap == VtsID_INVALID);
tl_assert(old_vts != NULL);
tl_assert(old_vts->id == i);
- tl_assert(old_vts->ts != NULL);
/* It is in use. Make a pruned version. */
nBeforePruning++;
------------------------------------------------------------------ */
/* Use this for normal null-termination-style string comparison. */
-#define VG_STREQ(s1,s2) ( (s1 != NULL && s2 != NULL \
+#define VG_STREQ(s1,s2) ( ((s1) != NULL && (s2) != NULL \
&& VG_(strcmp)((s1),(s2))==0) ? True : False )
-#define VG_STREQN(n,s1,s2) ( (s1 != NULL && s2 != NULL \
+#define VG_STREQN(n,s1,s2) ( ((s1) != NULL && (s2) != NULL \
&& VG_(strncmp)((s1),(s2),(n))==0) ? True : False )
extern SizeT VG_(strlen) ( const HChar* str );