Use umask() with the correct argument.
If you suspect misuse of umask(), you can use grep to spot call instances of umask().