strlcpy(s1,s2,sizeof(s2));// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
strlcpy(s1,s3,strlen(s3)+1);// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
strlcat(s2,s3,sizeof(s3));// expected-warning {{size argument in 'strlcat' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
strlcpy(s4.f1,s2,sizeof(s2));// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
strlcpy((*s5)->f2[x],s2,sizeof(s2));// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}
strlcpy(s1+3,s2,sizeof(s2));// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}}
strlcpy(s->x,str,sizeof(str));// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}}
}
// Don't issue FIXIT for destinations of size 1.
voidsize_1(){
charz[1];
charstr[]="hi";
strlcpy(z,str,sizeof(str));// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}}
}
// Support VLAs.
voidvlas(intsize){
charz[size];
charstr[]="hi";
strlcpy(z,str,sizeof(str));// expected-warning {{size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination}} expected-note {{change size argument to be the size of the destination}}