$OpenBSD$
--- generic/tclBinary.c.orig	Mon Jul 16 07:57:05 2012
+++ generic/tclBinary.c	Sat Jul 28 11:48:28 2012
@@ -1315,10 +1315,19 @@ Tcl_BinaryObjCmd(
 		break;
 	    case '@':
 		if (count == BINARY_NOCOUNT) {
-		    DeleteScanNumberCache(numberCachePtr);
-		    goto badCount;
-		}
-		if ((count == BINARY_ALL) || (count > length)) {
+		    if (arg >= objc) {
+			DeleteScanNumberCache(numberCachePtr);
+			goto badIndex;
+		    }
+		    valuePtr = Tcl_NewIntObj(offset);
+		    resultPtr = Tcl_ObjSetVar2(interp, objv[arg], NULL,
+			    valuePtr, TCL_LEAVE_ERR_MSG);
+		    arg++;
+		    if (resultPtr == NULL) {
+			DeleteScanNumberCache(numberCachePtr);
+			return TCL_ERROR;
+		    }
+		} else if ((count == BINARY_ALL) || (count > length)) {
 		    offset = length;
 		} else {
 		    offset = count;
