]> git.deb.at Git - pkg/abook.git/blobdiff - abook.c
vcard built-in import: fix segfaults when a subset of vcard ADR fields
[pkg/abook.git] / abook.c
diff --git a/abook.c b/abook.c
index 05ec4293d37290d4644ddd22b74782528864d93a..1651267a541ef44bc5352786ca121777ce298fd3 100644 (file)
--- a/abook.c
+++ b/abook.c
@@ -390,8 +390,8 @@ parse_command_line(int argc, char **argv)
                                selected_item_filter = select_output_item_filter(outformat);
                                break;
                        case OPT_OUTFORMAT_STR:
-                               strncpy(custom_format, optarg, FORMAT_STRING_LEN - 1);
-                               custom_format[FORMAT_STRING_LEN] = 0;
+                               strncpy(custom_format, optarg, FORMAT_STRING_LEN);
+                               custom_format[FORMAT_STRING_LEN - 1] = 0;
                                break;
                        case OPT_INFILE:
                                set_convert_var(infile);