summaryrefslogtreecommitdiffstats
path: root/generic/tkTextMark.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextMark.c')
-rw-r--r--generic/tkTextMark.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index 4cfa0ea..6a41c77 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.c
@@ -838,13 +838,10 @@ MarkFindNext(
* For non-mark name indices we want to return any marks that are
* right at the index.
*/
- const TkTextIndex *indexFromPtr;
- indexFromPtr = TkTextGetIndexFromObj(interp, textPtr, obj);
- if (indexFromPtr == NULL) {
+ if (TkTextGetObjIndex(interp, textPtr, obj, &index) != TCL_OK) {
return TCL_ERROR;
}
- memcpy(&index, indexFromPtr, sizeof(TkTextIndex));
for (offset = 0, segPtr = index.linePtr->segPtr;
segPtr != NULL && offset < index.byteIndex;
offset += segPtr->size, segPtr = segPtr->nextPtr) {
@@ -929,13 +926,10 @@ MarkFindPrev(
* For non-mark name indices we do not return any marks that are
* right at the index.
*/
- const TkTextIndex *indexFromPtr;
- indexFromPtr = TkTextGetIndexFromObj(interp, textPtr, obj);
- if (indexFromPtr == NULL) {
+ if (TkTextGetObjIndex(interp, textPtr, obj, &index) != TCL_OK) {
return TCL_ERROR;
}
- memcpy(&index, indexFromPtr, sizeof(TkTextIndex));
for (offset = 0, segPtr = index.linePtr->segPtr;
segPtr != NULL && offset < index.byteIndex;
offset += segPtr->size, segPtr = segPtr->nextPtr) {