Loading...
Searching...
No Matches
snprintf.c File Reference

GIS Library - snprintf() clone functions. More...

`#include <stdarg.h>`
`#include <stdio.h>`
`#include <grass/gis.h>`
Include dependency graph for snprintf.c:

Go to the source code of this file.

## Functions

int | G_snprintf (char *str, size_t size, const char *fmt,...)
| snprintf() clone.

## Detailed Description

GIS Library - snprintf() clone functions.

Todo
  if needed, implement alternative versions for portability. potential code source:
  - http://www.ijs.si/software/snprintf/
  - openssh's snprintf() implementation: bsd-snprintf.c

(C) 2001-2014 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
  Markus Neteler

Date
  2006-2008

Definition in file snprintf.c.

## Function Documentation

## G_snprintf()

int G_snprintf | ( | char * | str,
|  | size_t | size,
|  | const char * | fmt,
|  |  | ... )

snprintf() clone.

Note: The use of snprintf()/G_snprintf() is discouraged in favour of calculating how long the string will be and allocating enough memory!

Deprecated
  Use C99 standard function snprintf() instead.

Parameters

  [in] | str | input string
  [in] | size | length of string
  [in] | fmt |

Returns
  number of chars written

Definition at line 41 of file snprintf.c.

References count.