Skip to content

Commit b48faee

Browse files
authored
ext/snmp: no need to use a smart_string for error message (php#19171)
1 parent 5fdc022 commit b48faee

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

ext/snmp/snmp.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,21 +1038,18 @@ static bool snmp_session_set_auth_protocol(struct snmp_session *s, zend_string *
10381038
}
10391039
#endif
10401040

1041-
smart_string err = {0};
1042-
1043-
smart_string_appends(&err, "Authentication protocol must be \"SHA\"");
1041+
zend_value_error(
1042+
"Authentication protocol must be \"SHA\""
10441043
#ifdef HAVE_SNMP_SHA256
1045-
smart_string_appends(&err, " or \"SHA256\"");
1044+
" or \"SHA256\""
10461045
#endif
10471046
#ifdef HAVE_SNMP_SHA512
1048-
smart_string_appends(&err, " or \"SHA512\"");
1047+
" or \"SHA512\""
10491048
#endif
10501049
#ifndef DISABLE_MD5
1051-
smart_string_appends(&err, " or \"MD5\"");
1050+
" or \"MD5\""
10521051
#endif
1053-
smart_string_0(&err);
1054-
zend_value_error("%s", err.c);
1055-
smart_string_free(&err);
1052+
);
10561053
return false;
10571054
}
10581055
/* }}} */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy