Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change to avoid warning '\0' in format

  • Loading branch information...
commit 6f4d430ab2858011826a2ae8a66ce4fdb85f15d2 1 parent edbeddf
chris authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 examples/phystest.c
  2. +2 −2 src/input.c
View
4 examples/phystest.c
@@ -70,8 +70,8 @@ static void nearCallback(void *data, dGeomID o1, dGeomID o2)
contact[i].surface.mode = dContactBounce;// | dContactSoftCFM;
contact[i].surface.mu = dInfinity;
contact[i].surface.mu2 = 0;
- contact[i].surface.bounce = 0.2;
- contact[i].surface.bounce_vel = 0.2;
+ contact[i].surface.bounce = 0.4;
+ contact[i].surface.bounce_vel = 0.4;
//contact[i].surface.soft_cfm = 0.1;
}
int numc = dCollide(o1, o2, MAX_CONTACTS, &contact[0].geom,
View
4 src/input.c
@@ -133,7 +133,7 @@ bool *getKeys()
if(n >= 0 && eps != 0 && eps[0] != 0) {
// only check 1st usb keyboard....
char fn[256];
- sprintf(fn,"/dev/input/by-path/%s\0",eps[0]->d_name);
+ sprintf(fn,"/dev/input/by-path/%s%c",eps[0]->d_name,0); // %c 0 to avoid embedded '\0' in format
__key_fd=open(fn, O_RDONLY);
printf("%i %s\n",__key_fd,fn);
}
@@ -152,7 +152,7 @@ bool *getKeys()
struct joystick_t *getJoystick(int j) {
char devpath[20];
- sprintf(devpath,"/dev/input/js%i\0",j);
+ sprintf(devpath,"/dev/input/js%i%c",j,0);
struct joystick_t *js=malloc(sizeof(struct joystick_t));
js->fd = open(devpath, O_RDONLY);
Please sign in to comment.
Something went wrong with that request. Please try again.