Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
8263-erts-Use-strlen.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 8263-erts-Use-strlen.patch of Package erlang
From c99ad7461358a2428521b287e86e58d9e13167d3 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson <sverker@erlang.org> Date: Tue, 28 May 2024 19:43:38 +0200 Subject: [PATCH 3/4] erts: Use strlen --- erts/emulator/beam/hash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/hash.c b/erts/emulator/beam/hash.c index 5c8b43e6e2..67febabe8f 100644 --- a/erts/emulator/beam/hash.c +++ b/erts/emulator/beam/hash.c @@ -98,10 +98,8 @@ void hash_info(fmtfn_t to, void *arg, Hash* h) int hash_table_sz(Hash *h) { - int i; - for(i=0;h->name[i];i++); - i++; - return sizeof(Hash) + hash_get_slots(h)*sizeof(HashBucket*) + i; + const int name_len = strlen(h->name) + 1; + return sizeof(Hash) + hash_get_slots(h)*sizeof(HashBucket*) + name_len; } -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor