*/
setlocale(LC_ALL, ""); /* set locale to system defaults or to
* that specified by any LC_* env vars */
- if ((cs = nl_langinfo(CODESET)) != 0L)
+ if ((cs = nl_langinfo(CODESET)) != NULL)
strncpy(cron_default_mail_charset, cs, MAX_ENVSTR-1);
else
strcpy(cron_default_mail_charset, "US-ASCII");
if (PromptOnDelete == 1) {
printf("crontab: really delete %s's crontab? ", User);
fflush(stdout);
- if ((fgets(n, MAX_FNAME - 1, stdin) == 0L)
+ if ((fgets(n, MAX_FNAME - 1, stdin) == NULL)
|| ((n[0] != 'Y') && (n[0] != 'y'))
)
exit(0);
perror("swapping uids back");
exit(ERROR_EXIT);
}
- if (NewCrontab == 0L) {
+ if (NewCrontab == NULL) {
perror("fopen");
goto fatal;
}
printf("Do you want to retry the same edit? ");
fflush(stdout);
q[0] = '\0';
- if (fgets(q, sizeof q, stdin) == 0L)
+ if (fgets(q, sizeof q, stdin) == NULL)
continue;
switch (q[0]) {
case 'y':
void do_command(entry * e, user * u) {
pid_t pid = getpid();
int ev;
- char **jobenv = 0L;
+ char **jobenv = NULL;
Debug(DPROC, ("[%ld] do_command(%s, (%s,%ld,%ld))\n",
(long) pid, e->cmd, u->name,
fprintf(mail, "Date: %s\n", arpadate(&StartTime));
#endif /*MAIL_DATE */
fprintf(mail, "MIME-Version: 1.0\n");
- if (content_type == 0L) {
+ if (content_type == NULL) {
fprintf(mail, "Content-Type: text/plain; charset=%s\n",
cron_default_mail_charset);
}
char *nl = content_type;
size_t ctlen = strlen(content_type);
while ((*nl != '\0')
- && ((nl = strchr(nl, '\n')) != 0L)
+ && ((nl = strchr(nl, '\n')) != NULL)
&& (nl < (content_type + ctlen))
)
*nl = ' ';
fprintf(mail, "Content-Type: %s\n", content_type);
}
- if (content_transfer_encoding != 0L) {
+ if (content_transfer_encoding != NULL) {
char *nl = content_transfer_encoding;
size_t ctlen = strlen(content_transfer_encoding);
while ((*nl != '\0')
- && ((nl = strchr(nl, '\n')) != 0L)
+ && ((nl = strchr(nl, '\n')) != NULL)
&& (nl < (content_transfer_encoding + ctlen))
)
*nl = ' ';
* pclose returns -1 if stream is not associated with a
* `popened' command, or, if already `pclosed'.
*/
- if (pids == 0 || pids[fdes = fileno(iop)] == 0)
+ if (pids == NULL || pids[fdes = fileno(iop)] == 0L)
return (-1);
(void) fclose(iop);
/* "minute-ly" job: Every minute for given hour/dow/month/dom.
* Ensure that these jobs never run in the same minute:
*/
- minutely_time = time(0);
+ minutely_time = time(NULL);
Debug(DSCH, ("Minute-ly job. Recording time %lu\n", minutely_time));
}
*jobenv = build_env(e->envp);
- time_t job_run_time = time(0L);
+ time_t job_run_time = time(NULL);
if ((minutely_time > 0) && ((job_run_time / 60) != (minutely_time / 60))) {
/* if a per-minute job is delayed into the next minute
if (is_selinux_enabled() <= 0)
return 0;
- if (ucontextp == 0L)
+ if (ucontextp == NULL)
return -1;
- *ucontextp = 0L;
+ *ucontextp = NULL;
- if ((range = env_get("MLS_LEVEL", jobenv)) != 0L) {
+ if ((range = env_get("MLS_LEVEL", jobenv)) != NULL) {
context_t ccon;
if (!(ccon = context_new(u->scontext))) {
log_it(u->name, getpid(), "context_new FAILED for MLS_LEVEL",
if (is_selinux_enabled() <= 0)
return 0;
- if (u->scontext == 0L) {
+ if (u->scontext == NULL) {
if (security_getenforce() > 0) {
log_it(u->name, getpid(), "NULL security context for user", "", 0);
return -1;
void free_security_context(security_context_t * scontext) {
if (*scontext != NULL) {
freecon(*scontext);
- *scontext = 0L;
+ *scontext = NULL;
}
}
#endif