Plan 9 from Bell Labs’s /usr/web/sources/patch/maybe/usb-write-info-lim/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


/n/sources/plan9/sys/src/cmd/usb/usbd/../lib/dev.c:482,493 - ../lib/dev.c:481,494
  int
  devctl(Dev *dev, char *fmt, ...)
  {
- 	char buf[128];
+ 	char *s;
+ 	int r;
  	va_list arg;
- 	char *e;
  
  	va_start(arg, fmt);
- 	e = vseprint(buf, buf+sizeof(buf), fmt, arg);
+ 	s = vsmprint(fmt, arg);
  	va_end(arg);
- 	return write(dev->cfd, buf, e-buf);
+ 	r = write(dev->cfd, s, strlen(s));
+ 	free(s);
+ 	return r;
  }

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].