diff --git a/src/autotune.c b/src/autotune.c index 4219617ff..e77978d8e 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -287,8 +287,8 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param printf ( - "- Device #%u: autotuned kernel-accel to %u\n" - "- Device #%u: autotuned kernel-loops to %u\n", + "- Device #%u: autotuned kernel-accel to %u" EOL + "- Device #%u: autotuned kernel-loops to %u" EOL, device_param->device_id + 1, kernel_accel, device_param->device_id + 1, kernel_loops ); diff --git a/src/debugfile.c b/src/debugfile.c index 9e8c0941a..03b9cc1e7 100644 --- a/src/debugfile.c +++ b/src/debugfile.c @@ -75,7 +75,7 @@ void debugfile_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *rule_buf, con debugfile_format_plain (hashcat_ctx, mod_plain_ptr, mod_plain_len); } - fputc ('\n', debugfile_ctx->fp); + fwrite (EOL, strlen (EOL), 1, debugfile_ctx->fp); } int debugfile_init (hashcat_ctx_t *hashcat_ctx) diff --git a/src/hashes.c b/src/hashes.c index 836db5d6f..d2328fc4f 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -174,9 +174,7 @@ int save_hash (hashcat_ctx_t *hashcat_ctx) ascii_digest (hashcat_ctx, out_buf, salt_pos, digest_pos); - fputs (out_buf, fp); - - fputc ('\n', fp); + fprintf (fp, "%s" EOL, out_buf); } else { diff --git a/src/logfile.c b/src/logfile.c index 51514ab45..77b4990e1 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -62,7 +62,7 @@ void logfile_append (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...) va_end (ap); - fputc ('\n', fp); + fwrite (EOL, strlen (EOL), 1, fp); fflush (fp); diff --git a/src/loopback.c b/src/loopback.c index 973bcf8ca..47a7b1c32 100644 --- a/src/loopback.c +++ b/src/loopback.c @@ -146,7 +146,7 @@ void loopback_write_append (hashcat_ctx_t *hashcat_ctx, const u8 *plain_ptr, con loopback_format_plain (hashcat_ctx, plain_ptr, plain_len); - fputc ('\n', fp); + fwrite (EOL, strlen (EOL), 1, fp); fflush (fp); } diff --git a/src/mpsp.c b/src/mpsp.c index 7bb31973f..e810e767a 100644 --- a/src/mpsp.c +++ b/src/mpsp.c @@ -866,11 +866,11 @@ static void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *marko { cs_t *ptr = &markov_css_buf[(i * CHARSIZ) + j]; - printf ("pos:%u key:%u len:%u\n", i, j, ptr->cs_len); + printf ("pos:%u key:%u len:%u" EOL, i, j, ptr->cs_len); for (u32 k = 0; k < 10; k++) { - printf (" %u\n", ptr->cs_buf[k]); + printf (" %u" EOL, ptr->cs_buf[k]); } } } diff --git a/src/potfile.c b/src/potfile.c index b8dc4a150..7b9a1afd5 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -299,9 +299,7 @@ void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, u8 * tmp_buf[tmp_len] = 0; - fprintf (potfile_ctx->fp, "%s\n", tmp_buf); - - fflush (potfile_ctx->fp); + fprintf (potfile_ctx->fp, "%s" EOL, tmp_buf); } int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx) diff --git a/src/stdout.c b/src/stdout.c index a7020f18b..6f6d07803 100644 --- a/src/stdout.c +++ b/src/stdout.c @@ -25,10 +25,21 @@ static void out_push (out_t *out, const u8 *pw_buf, const int pw_len) memcpy (ptr, pw_buf, pw_len); + #if defined (_POSIX) + ptr[pw_len] = '\n'; out->len += pw_len + 1; + #else + + ptr[pw_len + 0] = '\r'; + ptr[pw_len + 1] = '\n'; + + out->len += pw_len + 2; + + #endif + if (out->len >= BUFSIZ - 100) { out_flush (out);