From 72bd96ab02daffa163f5dd42c3e97b4255af9d7d Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 8 Jan 2014 07:22:27 -0800 Subject: [PATCH] WBStringDrawingState::count_ is unsigned: no -1. --- Library.mm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Library.mm b/Library.mm index d4bd1a3..4e6e2fd 100644 --- a/Library.mm +++ b/Library.mm @@ -776,7 +776,7 @@ MSInstanceMessageHook6(CGSize, NSString, drawAtPoint,forWidth,withFont,lineBreak if (state == NULL) return MSOldCall(point, width, font, mode, spacing, emoji); - if (--state->count_ == 0) + if (state->count_ != 0 && --state->count_ == 0) stringDrawingState_ = state->next_; if (state->info_ == nil) return MSOldCall(point, width, font, mode, spacing, emoji); @@ -800,7 +800,7 @@ MSInstanceMessageHook7(CGSize, NSString, _drawInRect,withFont,lineBreakMode,alig if (state == NULL) return MSOldCall(rect, font, mode, alignment, spacing, emoji, truncation); - if (--state->count_ == 0) + if (state->count_ != 0 && --state->count_ == 0) stringDrawingState_ = state->next_; if (state->info_ == nil) return MSOldCall(rect, font, mode, alignment, spacing, emoji, truncation); @@ -841,7 +841,7 @@ MSInstanceMessageHook4(CGSize, NSString, sizeWithFont,forWidth,lineBreakMode,let if (state == NULL) return MSOldCall(font, width, mode, spacing); - if (--state->count_ == 0) + if (state->count_ != 0 && --state->count_ == 0) stringDrawingState_ = state->next_; if (state->info_ == nil) return MSOldCall(font, width, mode, spacing); @@ -862,7 +862,7 @@ MSInstanceMessageHook1(CGSize, NSString, sizeWithFont, UIFont *, font) { if (state == NULL) return MSOldCall(font); - if (--state->count_ == 0) + if (state->count_ != 0 && --state->count_ == 0) stringDrawingState_ = state->next_; if (state->info_ == nil) return MSOldCall(font); @@ -879,7 +879,7 @@ MSClassMessageHook2(UIImage *, SBIconAccessoryImage, checkoutAccessoryImageForIc if ([self _imageClassForIcon:icon location:location] != $SBIconBadgeImage) return MSOldCall(icon, location); - WBStringDrawingState badgeState = {NULL, -1, @"" + WBStringDrawingState badgeState = {NULL, 0, @"" , @"BadgeStyle"}; stringDrawingState_ = &badgeState; @@ -891,7 +891,7 @@ MSClassMessageHook2(UIImage *, SBIconAccessoryImage, checkoutAccessoryImageForIc } MSInstanceMessageHook1(UIImage *, SBIconBadgeFactory, checkoutBadgeImageForText, NSString *, text) { - WBStringDrawingState badgeState = {NULL, -1, @"" + WBStringDrawingState badgeState = {NULL, 0, @"" , @"BadgeStyle"}; stringDrawingState_ = &badgeState; -- 2.45.2