patch-lib_KIProto_c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. $OpenBSD: patch-lib_KIProto_c,v 1.1.1.1 2000/04/26 00:43:13 espie Exp $
  2. --- lib/KIProto.c.orig Thu May 27 01:55:24 1999
  3. +++ lib/KIProto.c Wed Apr 26 02:18:47 2000
  4. @@ -314,10 +314,10 @@ KinputProtocolWidget kpw;
  5. Display *dpy = XtDisplay((Widget)kpw);
  6. char buf[256];
  7. - (void)sprintf(buf, "_%s_CONVERSION", kpw->kinput.language);
  8. + (void)snprintf(buf, sizeof(buf), "_%s_CONVERSION", kpw->kinput.language);
  9. kpw->kinput.convAtom = XInternAtom(dpy, buf, False);
  10. if (kpw->kinput.backward_compatible) {
  11. - (void)sprintf(buf, "%s_CONVERSION", kpw->kinput.language);
  12. + (void)snprintf(buf, sizeof(buf), "%s_CONVERSION", kpw->kinput.language);
  13. kpw->kinput.oldConvAtom = XInternAtom(dpy, buf, False);
  14. } else {
  15. kpw->kinput.oldConvAtom = None;
  16. @@ -331,7 +331,7 @@ KinputProtocolWidget kpw;
  17. kpw->kinput.convNotifyAtom = MAKEATOM("CONVERSION_NOTIFY");
  18. kpw->kinput.convEndAtom = MAKEATOM("CONVERSION_END");
  19. - (void)sprintf(buf, "%s_CONVERSION_VERSION", kpw->kinput.language);
  20. + (void)snprintf(buf, sizeof(buf), "%s_CONVERSION_VERSION", kpw->kinput.language);
  21. kpw->kinput.convVersionAtom = XInternAtom(dpy, buf, False);
  22. kpw->kinput.convInitialTypeAtom = MAKEATOM("CONVERSION_INITIAL_TYPE");
  23. kpw->kinput.convOpenNotifyAtom = MAKEATOM("CONVERSION_OPEN_NOTIFY");
  24. @@ -1239,7 +1239,7 @@ long *modmaskp;
  25. * Ctrl, Shift, Lock, Meta, Alt, Mod1, Mod2, Mod3, Mod4, Mod5
  26. */
  27. - strcpy(buf, s);
  28. + strlcpy(buf, s, sizeof(buf));
  29. /* find "<Key>" */
  30. if ((p = mystrstr(buf, "<Key>")) != NULL) {