repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git]
/
old-autovect-branch
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
builtins
/
lib
/
strncpy.c
blob
b297345e6caa4f173f651c3183204ee60d59f697
1
extern
void
abort
(
void
);
2
extern
int
inside_main
;
3
4
typedef
__SIZE_TYPE__
size_t
;
5
6
char
*
7
strncpy
(
char
*
s1
,
const char
*
s2
,
size_t
n
)
8
{
9
char
*
dest
=
s1
;
10
#ifdef __OPTIMIZE__
11
if
(
inside_main
)
12
abort
();
13
#endif
14
for
(; *
s2
&&
n
;
n
--)
15
*
s1
++ = *
s2
++;
16
while
(
n
--)
17
*
s1
++ =
0
;
18
return
dest
;
19
}
20