projects
/
debian
/
amanda
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.5.1
[debian/amanda]
/
server-src
/
amindex.c
diff --git
a/server-src/amindex.c
b/server-src/amindex.c
index 2e763dc44b88225ae38bb16cce821af42cd149d8..b775c43d2a5b551ad4f943bbcaffcca5cc352f75 100644
(file)
--- a/
server-src/amindex.c
+++ b/
server-src/amindex.c
@@
-25,22
+25,26
@@
* University of Maryland at College Park
*/
/*
* University of Maryland at College Park
*/
/*
- * $Id: amindex.c,v 1.1
3 2001/09/01 03:36:24 jrjackson
Exp $
+ * $Id: amindex.c,v 1.1
5 2006/05/25 01:47:19 johnfranks
Exp $
*
* index control
*/
*
* index control
*/
+#include "amanda.h"
#include "conffile.h"
#include "amindex.h"
#include "conffile.h"
#include "amindex.h"
-char *getindexfname(host, disk, date, level)
-char *host, *disk, *date;
-int level;
+char *
+getindexfname(
+ char * host,
+ char * disk,
+ char * date,
+ int level)
{
char *conf_indexdir;
char *buf;
char level_str[NUM_STR_SIZE];
{
char *conf_indexdir;
char *buf;
char level_str[NUM_STR_SIZE];
- char datebuf[
8
+ 1];
+ char datebuf[
14
+ 1];
char *dc = NULL;
char *pc;
int ch;
char *dc = NULL;
char *pc;
int ch;
@@
-48,17
+52,19
@@
int level;
if (date != NULL) {
dc = date;
pc = datebuf;
if (date != NULL) {
dc = date;
pc = datebuf;
- while (pc < datebuf + sizeof (datebuf)) {
- if ((*pc++ = ch = *dc++) == '\0') {
+ while (pc < datebuf + SIZEOF(datebuf)) {
+ ch = *dc++;
+ *pc++ = (char)ch;
+ if (ch == '\0') {
break;
} else if (! isdigit (ch)) {
pc--;
}
}
break;
} else if (! isdigit (ch)) {
pc--;
}
}
- datebuf[
sizeof
(datebuf)-1] = '\0';
+ datebuf[
SIZEOF
(datebuf)-1] = '\0';
dc = datebuf;
dc = datebuf;
- snprintf(level_str,
sizeof
(level_str), "%d", level);
+ snprintf(level_str,
SIZEOF
(level_str), "%d", level);
}
host = sanitise_filename(host);
}
host = sanitise_filename(host);