X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Futils%2Fcitmail.c;h=651e561d7391fa269cd71d77cb868fddb3d09418;hb=1c90eb02a45314323ee882c0b898d1e607a86351;hp=becdb9abc870b5fdf5a0154d4832d0a2fe273c79;hpb=9baa08faebcffd26eb88ae2ae09408bcd65847a8;p=citadel.git diff --git a/citadel/utils/citmail.c b/citadel/utils/citmail.c index becdb9abc..651e561d7 100644 --- a/citadel/utils/citmail.c +++ b/citadel/utils/citmail.c @@ -228,7 +228,9 @@ int main(int argc, char **argv) { if (debug) fprintf(stderr, "citmail: error parsing hostname\n"); cleanup(3); } - *ep = '\0'; + else + *ep = '\0'; + strncpy(hostname, sp, sizeof hostname); snprintf(fromline, sizeof fromline, "From: %s@%s", pw->pw_name, hostname);