patch-contrib_motosend_c 859 B

1234567891011121314151617181920212223242526272829
  1. --- gpsd-2.39.orig/contrib/motosend.c 2008-06-26 21:08:36.000000000 +0200
  2. +++ gpsd-2.39/contrib/motosend.c 2009-06-13 09:12:46.000000000 +0200
  3. @@ -81,7 +81,7 @@ int main(int argc, char **argv) {
  4. t = 0; n = 0;
  5. while (1){
  6. usleep(1000);
  7. - bzero(buf, BSIZ);
  8. + memset(buf, 0, BSIZ);
  9. if ((l = read(fd, buf, BSIZ)) == -1)
  10. if (!(EINTR == errno || EAGAIN == errno))
  11. err(1, "read");
  12. @@ -119,7 +119,7 @@ static int moto_send(int fd, char *type,
  13. if ((buf = malloc(l+7)) == NULL)
  14. return -1;
  15. - bzero(buf, l+7);
  16. + memset(buf, 0, l+7);
  17. buf[0] = '@'; buf[1] = '@';
  18. buf[2] = type[0]; buf[3] = type[1];
  19. @@ -171,7 +171,7 @@ int gpsd_hexpack(char *src, char *dst, i
  20. if ((l < 1) || (l > len))
  21. return -1;
  22. - bzero(dst, len);
  23. + memset(dst, 0, len);
  24. for (i = 0; i < l; i++)
  25. if ((k = hex2bin(src+i*2)) != -1)
  26. dst[i] = (char)(k & 0xff);