Change in libosmocore[master]: osmo_fsm_state_name: make robust against NULL fi

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Jan 29 00:00:29 UTC 2019


Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/12670 )

Change subject: osmo_fsm_state_name: make robust against NULL fi
......................................................................

osmo_fsm_state_name: make robust against NULL fi

Change-Id: I61d4f7dfada2763948f330745ac886405d889a12
---
M include/osmocom/core/fsm.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Vadim Yanitskiy: Looks good to me, but someone else must approve



diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h
index 5bf5328..df7e348 100644
--- a/include/osmocom/core/fsm.h
+++ b/include/osmocom/core/fsm.h
@@ -220,7 +220,7 @@
 
 /*! return the name of the state the FSM instance is currently in. */
 static inline const char *osmo_fsm_inst_state_name(struct osmo_fsm_inst *fi)
-{ return osmo_fsm_state_name(fi->fsm, fi->state); }
+{ return fi ? osmo_fsm_state_name(fi->fsm, fi->state) : "NULL"; }
 
 /*! perform a state change of the given FSM instance
  *

-- 
To view, visit https://gerrit.osmocom.org/12670
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I61d4f7dfada2763948f330745ac886405d889a12
Gerrit-Change-Number: 12670
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190129/db7e9a30/attachment.htm>


More information about the gerrit-log mailing list