utf8nset

Fills a string with a specified character, for a specified length.

Library:LibC
Classification:Novell
Service:Characters and Strings

Syntax

  #include <utf8.h> 
   
  utf8_t  *utf8nset (
     utf8_t   *base,
     utf8_t   *ch,
     size_t    n);
  

Parameters

base

(OUT) Points to the string to fill.

ch

(IN) Specifies the character to copy.

n

(IN) Specifies the number of times to copy the fill character.

Return Values

Returns a pointer to the base string.

Remarks

The utf8nset function fills the base string with the value of the ch parameter, for the number of characters specified by n.

  • If the base string is longer than n characters, ch is copied to only n characters of the base string.

  • If the base string is shorter than n characters, ch is copied to the base string and beyond, which can result in memory corruption.

See Also