GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    ThePhD (thephd@pony.social)'s status on Monday, 04-Dec-2023 07:18:16 JST ThePhD ThePhD
    • наб

    @nabijaczleweli

    Hey, when I publish the paper for %z*.s everyone on the Committee is gonna bother me about not having it implemented anywhere. Do you know any C libraries where they're not stiff-neck about extensions of this nature?

    In conversation Monday, 04-Dec-2023 07:18:16 JST from pony.social permalink
    • Embed this notice
      ThePhD (thephd@pony.social)'s status on Monday, 04-Dec-2023 07:18:14 JST ThePhD ThePhD
      in reply to
      • Tóth Gábor Baltazár

      @tthbaltazar Extension for printf to use size_t for the size of string printouts.

      printf("%z*.s", my_str_size, my_str_ptr);

      Today, you can only have a size as big as INT_MAX, because printf's precision modifier for strings is spec'd to be int:

      printf("%*.s", (int)my_str_size, my_str_ptr); // cast it or suffer ABI break
      In conversation Monday, 04-Dec-2023 07:18:14 JST permalink
      Haelwenn /элвэн/ :triskell: likes this.
    • Embed this notice
      Tóth Gábor Baltazár (tthbaltazar@chaos.social)'s status on Monday, 04-Dec-2023 07:18:15 JST Tóth Gábor Baltazár Tóth Gábor Baltazár
      in reply to

      @thephd
      what is %z*.s?

      In conversation Monday, 04-Dec-2023 07:18:15 JST permalink
    • Embed this notice
      ThePhD (thephd@pony.social)'s status on Monday, 04-Dec-2023 07:19:06 JST ThePhD ThePhD
      in reply to
      • Tóth Gábor Baltazár

      @tthbaltazar I (occasionally) work on large systems where we handle data that easily overflows a 4 byte integer. I would like to not accidentally have an overflow vulnerability in my printing routines.

      In conversation Monday, 04-Dec-2023 07:19:06 JST permalink
    • Embed this notice
      ThePhD (thephd@pony.social)'s status on Monday, 04-Dec-2023 07:19:06 JST ThePhD ThePhD
      in reply to
      • Tóth Gábor Baltazár

      @tthbaltazar Not my wheelhouse entirely, but there's also systems with a 16-bit intand a 32-bit size_t. Which makes this problem infinitely worse.

      In conversation Monday, 04-Dec-2023 07:19:06 JST permalink
      Haelwenn /элвэн/ :triskell: likes this.
    • Embed this notice
      Tóth Gábor Baltazár (tthbaltazar@chaos.social)'s status on Monday, 04-Dec-2023 07:19:07 JST Tóth Gábor Baltazár Tóth Gábor Baltazár
      in reply to

      @thephd
      why are you printing strings longer than 2GB?

      In conversation Monday, 04-Dec-2023 07:19:07 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.