crash on planning a dive with LANG=fi

Thiago Macieira thiago at macieira.org
Sun Oct 11 13:46:46 PDT 2015


On Sunday 11 October 2015 10:41:12 Dirk Hohndel wrote:
> I notice the %S vs. %s - the man page doesn't mention upper case '%S', just
> lower case '%s'

The info page does:

`%S'
     This is an alias for `%ls' which is supported for compatibility
     with the Unix standard.

And later:

`l'
     Specifies that the argument is a `long int' or `unsigned long
     int', as appropriate.  Two `l' characters is like the `L'
     modifier, below.

     If used with `%c' or `%s' the corresponding parameter is
     considered as a wide character or wide character string
     respectively.  This use of `l' was introduced in Amendment 1 to
     ISO C90.


So %S is looking for a null-terminated string of wchar_t. Since the input 
string isn't wchar_t, it crashes on wcslen().
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the subsurface mailing list