Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

lib_str.h/lib_str.c

Prototype

Code Block
languagecpp
          CPU_CHAR  *Str_Copy_N (       CPU_CHAR    *pstr_dest,
                                 const  CPU_CHAR    *pstr_src,
                                        CPU_SIZE_T   len_max);


Arguments

pstr_dest

Pointer to the string memory buffer to copy string characters into.

...

String copy terminates if either string pointer points to or overlaps the NULL address.

Example Usage

Code Block
languagecpp
          CPU_CHAR   AppBuf[20];
          CPU_CHAR  *pstr;


          pstr = Str_Copy_N(&AppBuf[0], "Hello World!", (sizeof(AppBuf)));
          if (pstr == (CPU_CHAR *)0) {
              printf("STRING COPY FAILED!");
          }