"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "h5utils.c" between
h5utils-1.13.1.tar.gz and h5utils-1.13.2.tar.gz

About: h5utils is a set of utilities for visualization and conversion of scientific data in the free, portable HDF5 format.

h5utils.c  (h5utils-1.13.1):h5utils.c  (h5utils-1.13.2)
/* Copyright (c) 1999-2017 Massachusetts Institute of Technology /* Copyright (c) 1999-2023 Massachusetts Institute of Technology
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, * without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice shall be * The above copyright notice and this permission notice shall be
skipping to change at line 34 skipping to change at line 34
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "config.h" #include "config.h"
#include "h5utils.h" #include "h5utils.h"
#define CHECK(cond, msg) { if (!(cond)) { fprintf(stderr, "h5utils error: %s\n", msg); exit(EXIT_FAILURE); } } #define CHECK(cond, msg) { if (!(cond)) { fprintf(stderr, "h5utils error: %s\n", msg); exit(EXIT_FAILURE); } }
char *my_strdup(const char *s) char *my_strdup(const char *s)
{ {
char *sd = (char *) malloc(sizeof(char) * (strlen(s) + 1)); if (s) {
CHECK(sd, "out of memory"); char *sd = (char *) malloc(sizeof(char) * (strlen(s) + 1));
strcpy(sd, s); CHECK(sd, "out of memory");
return sd; strcpy(sd, s);
return sd;
}
return NULL;
} }
char *replace_suffix(const char *s, const char *old_suff, const char *new_suff) char *replace_suffix(const char *s, const char *old_suff, const char *new_suff)
{ {
char *new_s; char *new_s;
int s_len, old_suff_len, new_suff_len; int s_len, old_suff_len, new_suff_len;
s_len = strlen(s); s_len = strlen(s);
old_suff_len = strlen(old_suff); old_suff_len = strlen(old_suff);
new_suff_len = strlen(new_suff); new_suff_len = strlen(new_suff);
 End of changes. 2 change blocks. 
5 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)