- char tmp_buf[7 + 9 + 1]; /* "rounds=999999999" */
- sprintf(tmp_buf, "rounds=%lu", rounds);
- OPENSSL_strlcat(out_buf, tmp_buf, sizeof out_buf);
- OPENSSL_strlcat(out_buf, "$", sizeof out_buf);
+ char tmp_buf[80]; /* "rounds=999999999" */
+ sprintf(tmp_buf, "rounds=%u", rounds);
+#ifdef CHARSET_EBCDIC
+ /* In case we're really on a ASCII based platform and just pretend */
+ if (tmp_buf[0] != 0x72) /* ASCII 'r' */
+ ebcdic2ascii(tmp_buf, tmp_buf, strlen(tmp_buf));
+#endif
+ OPENSSL_strlcat(out_buf, tmp_buf, sizeof(out_buf));
+ OPENSSL_strlcat(out_buf, ascii_dollar, sizeof(out_buf));