version 1.25, 2014/07/20 01:38:40 |
version 1.26, 2015/01/16 06:40:08 |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
#include <sys/param.h> |
|
#include <fcntl.h> |
#include <fcntl.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <limits.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
* file */ |
* file */ |
char *out_name = "Standard Output"; /* will always point to name |
char *out_name = "Standard Output"; /* will always point to name |
* of output file */ |
* of output file */ |
char bakfile[MAXPATHLEN] = ""; |
char bakfile[PATH_MAX] = ""; |
|
|
void bakcopy(void); |
void bakcopy(void); |
|
|
|
|
p--; |
p--; |
if (*p == '/') |
if (*p == '/') |
p++; |
p++; |
if (snprintf(bakfile, MAXPATHLEN, "%s.BAK", p) >= MAXPATHLEN) |
if (snprintf(bakfile, PATH_MAX, "%s.BAK", p) >= PATH_MAX) |
errc(1, ENAMETOOLONG, "%s.BAK", p); |
errc(1, ENAMETOOLONG, "%s.BAK", p); |
|
|
/* copy in_name to backup file */ |
/* copy in_name to backup file */ |