Thank you very much for the info, but where exactly in the sources did you find this problem?
common2.h: 1767, 1791, 1911, 2024, 3243, 3500.
I hate the "safe string stuff". Just another number to get worry about.
Oh, I get a bunch of other diagnostics..... Most related to unchecked 'malloc's. Although in my humble opinion, when malloc starts to fail, everything else will too. FYI: Here's the complete dump - generated from 'Code Analysis' in Devstudio.
As you can see, I'm doing a C++/CLI version. It's complete, but I've got a lot of testing still to do.
----------------------------------------------------------------------------
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(615) : warning C6262: Function uses '17096' bytes of stack: exceeds /analyze:stacksize'16384'. Consider moving some data to heap
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(707) : warning C6011: Dereferencing NULL pointer 'NewFragment': Lines: 616, 617, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 638, 639, 647, 648, 649, 650, 651, 656, 657, 665, 669, 673, 674, 676, 679, 681, 685, 687, 693, 695, 701, 706, 707
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(730) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'sprintf_s': Lines: 616, 617, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 638, 639, 647, 648, 649, 650, 651, 656, 657, 665, 669, 673, 674, 676, 679, 681, 725, 726, 728, 729, 730
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(905) : warning C6262: Function uses '65616' bytes of stack: exceeds /analyze:stacksize'16384'. Consider moving some data to heap
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(1043) : warning C6262: Function uses '33936' bytes of stack: exceeds /analyze:stacksize'16384'. Consider moving some data to heap
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(1793) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'swprintf_s': Lines: 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 1732, 1733, 1734, 1737, 1738, 1739, 1740, 1741, 1746, 1747, 1752, 1753, 1754, 1758, 1764, 1767, 1768, 1769, 1770, 1772, 1773, 1776, 1777, 1778, 1782, 1789, 1800, 1801, 1805, 1806, 1807, 1813, 1814, 1815, 1816, 1821, 1824, 1829, 1830, 1891, 1752, 1753, 1754, 1758, 1764, 1767, 1768, 1769, 1770, 1772, 1773, 1776, 1777, 1778, 1782, 1789, 1800, 1801, 1805, 1806, 1807, 1813, 1814, 1815, 1816, 1821, 1824, 1829, 1830, 1891, 1752, 1753, 1754, 1758, 1764, 1767, 1768, 1769, 1770, 1772, 1773, 1774, 1776, 1777, 1778, 1782, 1789, 1790, 1791, 1792, 1793
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(1913) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'swprintf_s': Lines: 1902, 1903, 1904, 1905, 1906, 1909, 1910, 1911, 1912, 1913
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(2026) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'swprintf_s': Lines: 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1973, 1974, 1975, 1974, 1975, 1974, 1975, 1974, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2015, 2019, 2024, 2025, 2026
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(2027) : warning C6387: 'argument 2' might be '0': this does not adhere to the specification for the function '_wcsicmp': Lines: 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1973, 1974, 1975, 1974, 1975, 1974, 1975, 1974, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2015, 2019, 2024, 2025, 2026, 2027
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(2001) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'wcscpy_s': Lines: 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1973, 1974, 1975, 1974, 1975, 1974, 1975, 1974, 1999, 2000, 2001
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(2027) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function '_wcsicmp': Lines: 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1973, 1974, 1975, 1974, 1975, 1974, 1975, 1974, 1999, 2000, 2001, 2002, 2003, 2007, 2008, 2015, 2019, 2024, 2025, 2026, 2027
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(2994) : warning C6262: Function uses '32848' bytes of stack: exceeds /analyze:stacksize'16384'. Consider moving some data to heap
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(3249) : warning C6202: Buffer overrun for 'Data.VolumeName', which is possibly stack allocated, in call to 'GetVolumeNameForVolumeMountPointW': length '520' exceeds buffer size '102'
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(3249) : warning C6386: Buffer overrun: accessing 'argument 2', the writable size is '102' bytes, but '520' bytes might be written: Lines: 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3200, 3216, 3228, 3229, 3230, 3233, 3234, 3238, 3239, 3243, 3244, 3245, 3249
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(3245) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'swprintf_s': Lines: 3131, 3132, 3133, 3134, 3135, 3136, 3137, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 3152, 3153, 3154, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 3177, 3178, 3179, 3180, 3181, 3182, 3183, 3184, 3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195, 3196, 3200, 3216, 3228, 3229, 3230, 3233, 3234, 3238, 3239, 3243, 3244, 3245
d:\jkdefrag-src-3.8\jkdefragcli\common2.h(3502) : warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'swprintf_s': Lines: 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3424, 3427, 3428, 3432, 3433, 3442, 3443, 3451, 3452, 3462, 3463, 3464, 3468, 3470, 3477, 3484, 3487, 3497, 3498, 3500, 3501, 3502