GitXplorerGitXplorer
i

safe_snprintf

public
6 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
97fcc4ed572507a1b7822e3a4a7eed36969633f2

fix macros

iidning committed 11 years ago
Unverified
95a5ca73ee6ab449e79a195b81d81e8d32fcc504

use macros

iidning committed 11 years ago
Unverified
9d9fa218dccf8c87a3419a94d1597b262b6442e5

change return value of safe_snprintf to int, like snprintf

iidning committed 11 years ago
Unverified
fe2ec8536aed549068c04e3a17e3393d09bcdad8

fix compile warning

iidning committed 11 years ago
Unverified
d60c2e44349c7bf474f3cb54b0019dc8e3dadc67

use indent to format code

iidning committed 11 years ago
Unverified
86a227d6ec387a4e81bc70c305c081161bb67f0c

init ci

iidning committed 11 years ago

README

The README file for this repository.
  • A (very) limited version of snprintf.
  • async-signal-safe
  • code based on mysql my_safe_snprintf

::

/**
  A (very) limited version of snprintf.
  @param   to   Destination buffer.
  @param   n    Size of destination buffer.
  @param   fmt  printf() style format string.
  @returns Number of bytes written, including terminating '\0'
  Supports 'd' 'i' 'u' 'x' 'p' 's' conversion.
  Supports 'l' and 'll' modifiers for integral types.
  Does not support any width/precision.
  Implemented with simplicity, and async-signal-safety in mind.
*/
size_t safe_snprintf(char *to, size_t n, const char *fmt, ...);