]> andersk Git - splint.git/blame - test/simplebufferConstraintTests/sizeof.c
Changed to used /\ and requires instead of bufferConstraint
[splint.git] / test / simplebufferConstraintTests / sizeof.c
CommitLineData
41320549 1
2extern void /*@alt char * @*/
3 mystrncpy (/*@unique@*/ /*@out@*/ /*@returned@*/ char *s1, char *s2,
4size_t n)
dcaf75ea 5 /*@modifies *s1@*/ /*@requires MaxSet(s1) >= ( n - 1
6) /\ MaxRead (s2) >= ( n - 1 ); @*/ /*@ensures MaxRead (s1) ==
7MaxRead (s2) /\ MaxRead (s1) <= n; @*/;
41320549 8
dcaf75ea 9 void f(char *z) /*@requires MaxRead(z) >= 2; @*/
41320549 10{
11char x[3];
12char y[3];
13
14mystrncpy (x, z, 3);
15mystrncpy (y, z, 3);
16
17x[(sizeof x)] = 'i';
18y[((sizeof y) - 1)] = '0';
19
20}
This page took 0.065092 seconds and 5 git commands to generate.