C99-snprintf 1.0 (Default branch)


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements Software Releases - RSS News C99-snprintf 1.0 (Default branch)
# 1  
Old 01-06-2008
C99-snprintf 1.0 (Default branch)

C99‑snprintf is a free, portable, and C99 compliant implementation of the snprintf(3), vsnprintf(3), asprintf(3), and vasprintf(3) functions. It can be included with software packages as replacement code for systems which don't provide (C99 compliant versions of) these functions.Image

More...
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Solaris

How to combine c11 and c99 compilers?

I have a SPARC server with Solaris SPARC 10 OS installed I am trying to compile source code from VLC media player and PHP 7 tarballs However the stumbling block I encounter is that when I type in ./configure into my PUTTY terminal the GCC compiler tells me halfway through configuration that... (3 Replies)
Discussion started by: alphatron150
3 Replies

2. Shell Programming and Scripting

search sprintf and replace with snprintf

Hi, anyone knows the perl search-and-replace expression for strcpy (char * destination, const char * source ); to strncpy ( char * destination, const char * source, size_t num ); ? the first and second arguments are the same (destination and source), the difference being that strncpy... (1 Reply)
Discussion started by: ChaMeN
1 Replies

3. Shell Programming and Scripting

Perl script to search sprintf and replace with snprintf

Dear all, I am new to perl script and would need some help for my 1st script. I wrote a script to search sprintf(buf,"%s", sourcestring) and replace with snprintf(buf, sizeof(buf),"%s", sourcestring). As snprintf() requires an extra argument, so it is not a simple search-and-replace. I need to... (1 Reply)
Discussion started by: ChaMeN
1 Replies

4. Programming

does snprintf guarantee null termination?

Hi All, I was reading the man page of snprintf function and it saids that snprintf adds a null terminator at the end of the string, but I remember once someone told me that snprintf doesn't guarantee the insertion of a null terminator character. What do you think? Does anyone have experience... (4 Replies)
Discussion started by: lagigliaivan
4 Replies

5. Solaris

problem with sprintf snprintf in Solaris

******************************** Following is not the real issue. The issue is with popen. Plz continue forward with the thread to get a better picture. ******************************** Hi, I am working on a customised ftp application. In it we have used sprintf to store a UNIX command... (7 Replies)
Discussion started by: diganta
7 Replies
Login or Register to Ask a Question
ASPRINTF(3)						     Linux Programmer's Manual						       ASPRINTF(3)

NAME
asprintf, vasprintf - print to allocated string SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */ #include <stdio.h> int asprintf(char **strp, const char *fmt, ...); int vasprintf(char **strp, const char *fmt, va_list ap); DESCRIPTION
The functions asprintf() and vasprintf() are analogs of sprintf(3) and vsprintf(3), except that they allocate a string large enough to hold the output including the terminating null byte (''), and return a pointer to it via the first argument. This pointer should be passed to free(3) to release the allocated storage when it is no longer needed. RETURN VALUE
When successful, these functions return the number of bytes printed, just like sprintf(3). If memory allocation wasn't possible, or some other error occurs, these functions will return -1, and the contents of strp are undefined. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +------------------------+---------------+----------------+ |Interface | Attribute | Value | +------------------------+---------------+----------------+ |asprintf(), vasprintf() | Thread safety | MT-Safe locale | +------------------------+---------------+----------------+ CONFORMING TO
These functions are GNU extensions, not in C or POSIX. They are also available under *BSD. The FreeBSD implementation sets strp to NULL on error. SEE ALSO
free(3), malloc(3), printf(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2017-09-15 ASPRINTF(3)