logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0003-Remove-use-of-statement-expressions.patch (1212B)


  1. From 40df4efea0f6c964d1b35fa63737d53411e806e6 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 1 May 2021 01:38:52 -0700
  4. Subject: [PATCH] Remove use of statement-expressions
  5. This is a GNU C extension.
  6. ---
  7. tools/zynqmpbif.c | 14 +++++---------
  8. 1 file changed, 5 insertions(+), 9 deletions(-)
  9. diff --git a/tools/zynqmpbif.c b/tools/zynqmpbif.c
  10. index fbba768ed8..4d529ed785 100644
  11. --- a/tools/zynqmpbif.c
  12. +++ b/tools/zynqmpbif.c
  13. @@ -810,13 +810,6 @@ static const struct bif_file_type *get_file_type(struct bif_entry *entry)
  14. return NULL;
  15. }
  16. -#define NEXT_CHAR(str, chr) ({ \
  17. - char *_n = strchr(str, chr); \
  18. - if (!_n) \
  19. - goto err; \
  20. - _n; \
  21. -})
  22. -
  23. static char *skip_whitespace(char *str)
  24. {
  25. while (*str == ' ' || *str == '\t')
  26. @@ -848,11 +841,14 @@ int zynqmpbif_copy_image(int outfd, struct image_tool_params *mparams)
  27. bifp = bif;
  28. /* A bif description starts with a { section */
  29. - bifp = NEXT_CHAR(bifp, '{') + 1;
  30. + if (!(bifp = strchr(bifp, '{')))
  31. + goto err;
  32. + ++bifp;
  33. /* Read every line */
  34. while (1) {
  35. - bifpn = NEXT_CHAR(bifp, '\n');
  36. + if (!(bifp = strchr(bifp, '\n')))
  37. + goto err;
  38. if (bifpn[-1] == '\r')
  39. bifpn[-1] = '\0';
  40. --
  41. 2.31.1