You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to C99 specification, if the buffer is not sufficiently large, snprintf should still return the number of characters that would have been written. However, the implementation that DMD uses by default on Windows returns -1 instead.
voidmain() {
importcore.stdc.stdio;
auto n = snprintf(null, 0, "test");
assert(n ==4); //fails
}
Comments
The text was updated successfully, but these errors were encountered:
ogion.art reported this on 2021-09-02T12:09:26Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=22266
Description
According to C99 specification, if the buffer is not sufficiently large, snprintf should still return the number of characters that would have been written. However, the implementation that DMD uses by default on Windows returns -1 instead.
Comments
The text was updated successfully, but these errors were encountered: