diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-28 14:12:09 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-02-28 14:12:09 -0800 |
commit | f7246b984c287b64eb73ee0c303f1b61ee51caf2 (patch) | |
tree | 845c12f885a5754f43516aba001988873f12b98e /src/Label.c | |
parent | 02d6fcb26ee1c77c26d98372898d0e48542da5cb (diff) | |
download | xorg-lib-libXaw-f7246b984c287b64eb73ee0c303f1b61ee51caf2.tar.gz |
Replace calls to index() with strchr()
Use C standard API instead of old BSD equivalent
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Label.c')
-rw-r--r-- | src/Label.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Label.c b/src/Label.c index 4c95d42..cec1875 100644 --- a/src/Label.c +++ b/src/Label.c @@ -305,12 +305,12 @@ SetTextWidthAndHeight(LabelWidget lw) lw->label.label_len = 0; lw->label.label_width = 0; } - else if ((nl = index(lw->label.label, '\n')) != NULL) { + else if ((nl = strchr(lw->label.label, '\n')) != NULL) { char *label; lw->label.label_len = MULTI_LINE_LABEL; lw->label.label_width = 0; - for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) { + for (label = lw->label.label; nl != NULL; nl = strchr(label, '\n')) { int width = XmbTextEscapement(fset, label, (int)(nl - label)); if (width > (int)lw->label.label_width) @@ -338,12 +338,12 @@ SetTextWidthAndHeight(LabelWidget lw) lw->label.label_len = 0; lw->label.label_width = 0; } - else if ((nl = index(lw->label.label, '\n')) != NULL) { + else if ((nl = strchr(lw->label.label, '\n')) != NULL) { char *label; lw->label.label_len = MULTI_LINE_LABEL; lw->label.label_width = 0; - for (label = lw->label.label; nl != NULL; nl = index(label, '\n')) { + for (label = lw->label.label; nl != NULL; nl = strchr(label, '\n')) { int width; if (lw->label.encoding) @@ -537,7 +537,7 @@ XawLabelRedisplay(Widget gw, XEvent *event, Region region) if (len == MULTI_LINE_LABEL) { char *nl; - while ((nl = index(label, '\n')) != NULL) { + while ((nl = strchr(label, '\n')) != NULL) { XmbDrawString(XtDisplay(w), XtWindow(w), w->label.fontset, gc, w->label.label_x, ksy, label, (int)(nl - label)); @@ -554,7 +554,7 @@ XawLabelRedisplay(Widget gw, XEvent *event, Region region) if (len == MULTI_LINE_LABEL) { char *nl; - while ((nl = index(label, '\n')) != NULL) { + while ((nl = strchr(label, '\n')) != NULL) { if (w->label.encoding) XDrawString16(XtDisplay(gw), XtWindow(gw), gc, w->label.label_x, y, |