Thanks Chris for pointing this out.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
oflag &= ~(O_EXCL);
/* O_TRUNC has no meaning if (O_CREAT | O_EXCL) is specified */
oflag &= ~(O_EXCL);
/* O_TRUNC has no meaning if (O_CREAT | O_EXCL) is specified */
- if ((oflag & O_CREAT) & (oflag & O_EXCL))
+ if ((oflag & O_CREAT) && (oflag & O_EXCL))
oflag &= ~(O_TRUNC);
/* Todo: Are there any more flag combos to sanitise ? */
oflag &= ~(O_TRUNC);
/* Todo: Are there any more flag combos to sanitise ? */