{
rprintf(FERROR, "ERROR: out of memory in %s [%s]\n", str, who_am_i());
exit_cleanup(RERR_MALLOC);
}
{
rprintf(FERROR, "ERROR: out of memory in %s [%s]\n", str, who_am_i());
exit_cleanup(RERR_MALLOC);
}
{
rprintf(FERROR, "ERROR: buffer overflow in %s [%s]\n", str, who_am_i());
exit_cleanup(RERR_MALLOC);
}
{
rprintf(FERROR, "ERROR: buffer overflow in %s [%s]\n", str, who_am_i());
exit_cleanup(RERR_MALLOC);
}
* across filesystems, -2 if copy_file() failed, and -1 on other errors.
* If partialptr is not NULL and we need to do a copy, copy the file into
* the active partial-dir instead of over the destination file. */
* across filesystems, -2 if copy_file() failed, and -1 on other errors.
* If partialptr is not NULL and we need to do a copy, copy the file into
* the active partial-dir instead of over the destination file. */
-int robust_rename(char *from, char *to, char *partialptr,
+int robust_rename(const char *from, const char *to, const char *partialptr,
/* Like chdir(), but it keeps track of the current directory (in the
* global "curr_dir"), and ensures that the path size doesn't overflow.
* Also cleans the path using the clean_fname() function. */
/* Like chdir(), but it keeps track of the current directory (in the
* global "curr_dir"), and ensures that the path size doesn't overflow.
* Also cleans the path using the clean_fname() function. */
* Reverse a push_dir() call. You must pass in an absolute path
* that was copied from a prior value of "curr_dir".
**/
* Reverse a push_dir() call. You must pass in an absolute path
* that was copied from a prior value of "curr_dir".
**/
/* There's extra room in buf prior to the start of the num. */
buf -= decimal_digits + 1;
snprintf(buf, len + decimal_digits + 2, "%.*f", decimal_digits, dnum);
/* There's extra room in buf prior to the start of the num. */
buf -= decimal_digits + 1;
snprintf(buf, len + decimal_digits + 2, "%.*f", decimal_digits, dnum);
if (!ptr)
return malloc(size * num);
return realloc(ptr, size * num);
if (!ptr)
return malloc(size * num);
return realloc(ptr, size * num);
if (strcmp(s+1, "orig") == 0)
continue;
} else if (s_len > 2 && had_tilde
if (strcmp(s+1, "orig") == 0)
continue;
} else if (s_len > 2 && had_tilde
break;
/* Determine if the suffix is all digits. */
for (s++, s_len--; s_len > 0; s++, s_len--) {
break;
/* Determine if the suffix is all digits. */
for (s++, s_len--; s_len > 0; s++, s_len--) {