Changeset - 909353f139a6
[Not reviewed]
default
0 1 0
ethanzonca - 16 years ago 2009-08-01 18:27:02

Removed int_to_char(), left stub
1 file changed with 2 insertions and 26 deletions:
0 comments (0 inline, 0 general)
src/server/slavefuncs.c
Show inline comments
 
@@ -30,40 +30,16 @@
 
#include <string.h>
 
#include <unistd.h>
 
#include <stdlib.h>
 
#include <sys/stat.h>
 
#include <fcntl.h>
 

	
 
/** Converts an integer to a string, in ANSI C, thanks to Dom_ (http://www.signalsondisplay.com/) */
 
/** Converts an integer to a string, currently a stub. */
 
char *int_to_str(int nbr)
 
{
 
  int   div;
 
  int   len;
 
  int   i;
 
  char  *res;
 
  res = malloc(4 * sizeof(*res)); // Was xmalloc, hopefully it still works :D
 
  i = 0;
 
  while (i < 3)
 
    res[i++] = '\0';
 
  res[3] = '\0';
 
  i = 0;
 
  div = 1;
 
  len = 1;
 
  while (nbr / div >= 10)
 
    {
 
      div *= 10;
 
      len++;
 
    }
 
  while (len)
 
    {
 
      res[i++] = '0' + (nbr / div);
 
      len--;
 
      nbr %= div;
 
      div /= 10;
 
    }
 
  return (res);
 
 return;
 
}
 

	
 
/** Generates a SSH key with ssh-keygen */
 
int ssh_keygen(){
 
	/* Checks to see if the keys are already present. */
 
	int status;
0 comments (0 inline, 0 general)