~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to system/lib/libc/musl/src/string/wcsncpy.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <wchar.h>
 
2
 
 
3
wchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n)
 
4
{
 
5
        wchar_t *a = d;
 
6
        while (n && *s) n--, *d++ = *s++;
 
7
        wmemset(d, 0, n);
 
8
        return a;
 
9
}