Skip to content
  • Thomas Haller's avatar
    platform: add buffer argument to platform to-string functions · a2d59f5f
    Thomas Haller authored
    Arguably, it is more convenient to use the static buffer as
    it saves typing.
    
    But having such a low-level function use a static buffer also
    limits the way how to use it. As it was, you could not avoid
    using the static buffer.
    
    E.g. you cannot do:
    
      char buf[100];
    
      _LOGD ("nmp-object: %s; platform-link: %s",
             nmp_object_to_string (nmpobj, buf, sizeof(buf)),
             nm_platform_link_to_string (link));
    
    This will fail for non-obvious reasons because both
    to-string functions end up using the same static buffer.
    
    Also change the to-string implementations to accept NULL
    as valid and return it as "(null)".
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756427
    a2d59f5f