Commit Graph
13 Commits
Author SHA1 Message Date
JJenkxandClaude Opus 5.5 4eacfd4c6f fix(libc): leave errno alone for out-of-range float and double in swscanf
The wide scanf family converted %f, %e, %g and %a with strtof and
strtod, which set ERANGE when the value overflows or underflows. The
libc.prx that titles ship stores the same infinity or zero there
without touching errno for float and double, and sets ERANGE only for
an out-of-range long double. Restore errno after the float and double
conversions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:11:05 -04:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Dean Galvin 2f5366ea80 Merge main into feat/libc-swscanf-wide-synonyms 2026-10-24 17:17:02 +13:00
hypermist 3563fa21c4 Merge remote-tracking branch 'upstream/main' into fix/libc-utf8-multibyte 2026-10-23 13:27:39 +13:00
Adrià FranchandClaude e8c73627f6 fix(libc): keep %% at end of input an input failure in the wide scanner
Co-Authored-By: Claude <[email protected]>
2026-10-22 20:11:40 +02:00
MarcZX10 4a67c165b6 fix(libc): match reported wide scanf edge cases 2026-10-22 20:11:31 +02:00
hypermist 193d3c000d Merge remote-tracking branch 'upstream/main' into fix/libc-utf8-multibyte 2026-10-22 14:30:27 +13:00
hypermistandClaude Opus 5.5 8e46144d48 fix(libc): follow the console for integer bases and 0x prefixes
- strtol, strtoul, strtoll, strtoull and strtouq return 0 for a base
  outside 0 and 2 to 36, leave the end at the start and set EINVAL;
  strtoimax, strtoumax, _Stoull, _Stoul and the wide forms do the same
  without errno.
- A 0x prefix with no hexadecimal digit after it (base 0 or 16) is no
  conversion: the end stays at the start of the string.
- wcstol, wcstoll and wcstoimax take one sign, convert the rest with
  wcstoull and clamp to the signed range with ERANGE, so "- 1" is -1
  and "+\t-1" overflows.
- atoi, atol and atoll truncate strtoull's result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-21 16:05:00 +13:00
ZSWoltandClaude Opus 5.5 4d10a0d002 fix(libc): end swscanf at %S and %C as a matching failure
swscanf and swscanf_s threw "unsupported conversion" for %S and %C.
The console's Dinkumware wide scanner, read from the libc.prx that
PPSA21564 ships, treats them as invalid conversions: the scan stops
there and returns the fields assigned before them. A length modifier
or suppression does not change that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 21:58:46 +03:00
hypermistandClaude Opus 5.5 906f18f609 fix(libc): convert multibyte text as UTF-8 like the console's C locale
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-21 02:51:59 +13:00
aspct3434andClaude Opus 5.5 2a45c85ac1 feat(libc): scan %p in swscanf and swscanf_s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 16:16:16 +04:00
screammandClaude Fable 5.1 8aa0d42824 feat(libc): implement swscanf
swscanf (HNnWdT43ues) runs the swscanf_s scanner without the buffer
size arguments after %s, %c and %[, as FreeBSD's swscanf.c passes its
arguments to vswscanf. Both entry points share one engine with a flag
for the sizes; swscanf_s behaves as before.

Title: PS5CEMU-HAR PPSA99360 imports swscanf from libSceLibcInternal.prx
(import audit with --trap-sdk-syscall-stubs, registry index 292, right
after pthread_setaffinity_np at 276). Predicted stop line once
pthread_setaffinity_np resolves, without this change:
FAIL: unresolved ELF import HNnWdT43ues (swscanf) from libSceLibcInternal.prx

NID from tools/nid_names.py, confirmed in shadPS4 aerolib.inl:51950
(e0a466753a1a). Prototype in ps5-payload-dev include/freebsd/wchar.h:133,
export in sce_stubs/libSceLibcInternal.c:8582 (f5d40f02770e).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-14 11:17:04 +13:00
DavidandClaude Fable 5.1 51fca3cec3 feat(libc): implement _WStoul, _Iswctype and swscanf_s
Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-10 23:44:00 +02:00