From 0995671d43d593abd9e01726b8c804544904f46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Mon, 14 Dec 2015 17:49:49 +0100 Subject: [PATCH] Don't rely on side effects between sequence points --- t/t__string.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/t__string.c b/t/t__string.c index 4909d09..f15b672 100644 --- a/t/t__string.c +++ b/t/t__string.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Dag-Erling Smørgrav + * Copyright (c) 2014-2015 Dag-Erling Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -256,7 +256,8 @@ t_string_trunc(char **desc CRYB_UNUSED, void *arg CRYB_UNUSED) int ret; s = string_dup_cs(T_MAGIC_STR, SIZE_MAX); - ret = t_compare_ssz(T_MAGIC_LEN, len = string_len(s)) & + len = string_len(s); + ret = t_compare_ssz(T_MAGIC_LEN, len) & t_compare_ssz(len, string_trunc(s, SIZE_MAX)) & t_compare_ssz(len, string_trunc(s, len + 1)) & t_compare_ssz(len, string_trunc(s, len)) &