projects
/
opencv
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
4e4882387c578b13b8ffc6b5ab7c2a324f41c4d3
[opencv]
/
apps
/
Hawk
/
CVEiCL
/
EiC
/
module
/
stdClib
/
src
/
strround.c
1
int strround(char *s,int len)
2
{
3
/* string rounding function
4
* (c) Edmond J. Breen.
5
* round back the numbers in a string
6
* and fill with zeros.
7
* where: 'len' is the length of the string.
8
* Returns 1 on success
9
* and 0 if over flow has occurred.
10
*/
11
if(len>0)
12
if(s[--len] >= '5') {
13
do {
14
s[len--] = '0';
15
} while(len > 0 && s[len] == '9');
16
if(s[len] == '9')
17
return 0;
18
s[len]++;
19
}
20
return 1;
21
}