Skip to content
Snippets Groups Projects
Commit 6966a81b authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Create i64toac() to generate comma-separated ASCII string of 64-bit int

parent 1bea8247
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -495,6 +495,23 @@ char* ultoac(ulong l, char *string)
return(string);
}
char* i64toac(int64_t l, char *string)
{
char str[256];
int i,j,k;
_i64toa(l,str,10);
i=strlen(str)-1;
j=i/3+1+i;
string[j--]=0;
for(k=1;i>-1;k++) {
string[j--]=str[i--];
if(j>0 && !(k%3))
string[j--]=',';
}
return string;
}
/****************************************************************************/
/* Truncate string at first occurrence of char in specified character set */
/* Returns a pointer to the terminating NUL if the string was truncated, */
......
......@@ -64,6 +64,7 @@ DLLEXPORT BOOL valid_ctrl_a_attr(char a);
DLLEXPORT BOOL valid_ctrl_a_code(char a);
DLLEXPORT size_t strip_invalid_attr(char *str);
DLLEXPORT char * ultoac(ulong l,char *str);
DLLEXPORT char * i64toac(int64_t, char *str);
DLLEXPORT char * rot13(char* str);
DLLEXPORT uint32_t str_to_bits(uint32_t currval, const char *str);
DLLEXPORT BOOL str_has_ctrl(const char*);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment