Compare commits

...

2 Commits

  1. 2
      character.c
  2. 4
      chargen.c

@ -144,9 +144,11 @@ void genRace(){
addLanguage(DWARVISH);
stats[CON]+=2;
subrace = arc4random_uniform(2);
strlcat(otherprofs, "Artisan Tools, ", sizeof(otherprofs));
if(subrace == 0){
race = "Hill Dwarf";
stats[WIS]+=1;
hp = hp + 1;
}else{
race = "Mountain Dwarf";
stats[STR]+=2;

@ -251,7 +251,7 @@ int main(int argc, char **argv)
//rval = sendto(s, "chargen data\r\n", 14, 0, sa, len);
char character[512];
genChar(character);
rval = sendto(s, character, 512, 0, sa, len);
rval = sendto(s, character, strnlen(character,512), 0, sa, len);
if (rval == -1)
warn("sendto");
}
@ -288,7 +288,7 @@ int main(int argc, char **argv)
}
char character[512];
genChar(character);
if (write(s, character, 512) == -1)
if (write(s, character, strnlen(character,512)) == -1)
{
warn("write");
printf("Closing stream connection\n");

Loading…
Cancel
Save