projects
/
onak.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cscvs to tla changeset 14
[onak.git]
/
add.c
diff --git
a/add.c
b/add.c
index d820b528fe30b5b1011e7246a334fec67679223a..95f218943b5dcaab6540201e116fe57bce2e5608 100644
(file)
--- a/
add.c
+++ b/
add.c
@@
-51,11
+51,19
@@
int main(int argc, char *argv[])
for (i = 0; params != NULL && params[i] != NULL; i += 2) {
if (!strcmp(params[i], "keytext")) {
ctx.buffer = params[i+1];
for (i = 0; params != NULL && params[i] != NULL; i += 2) {
if (!strcmp(params[i], "keytext")) {
ctx.buffer = params[i+1];
+ } else {
+ free(params[i+1]);
}
}
+ params[i+1] = NULL;
+ free(params[i]);
+ params[i] = NULL;
+ }
+ if (params != NULL) {
+ free(params);
+ params = NULL;
}
}
- puts("Content-Type: text/html\n");
- puts("<html><title>onak : Add</title><body>");
+ start_html("onak : Add");
if (ctx.buffer == NULL) {
puts("Error: No keytext to add supplied.");
} else {
if (ctx.buffer == NULL) {
puts("Error: No keytext to add supplied.");
} else {
@@
-66,12
+74,12
@@
int main(int argc, char *argv[])
parse_keys(packets, &keys);
initdb();
printf("Got %d new keys.\n",
parse_keys(packets, &keys);
initdb();
printf("Got %d new keys.\n",
- update_keys(&keys));
+ update_keys(&keys
, false
));
cleanupdb();
} else {
puts("No OpenPGP packets found in input.");
}
}
cleanupdb();
} else {
puts("No OpenPGP packets found in input.");
}
}
-
puts("</body></html>"
);
+
end_html(
);
return (EXIT_SUCCESS);
}
return (EXIT_SUCCESS);
}