Add missing permission notice in each source file
[babeltrace.git] / lib / iterator.c
index c50b0ef36c18085496b0933832b9dd3df5ec3044..41a46020f6c690b4cc253044d845c0919e34cf0f 100644 (file)
  *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  */
 
 #include <stdlib.h>
@@ -253,7 +261,7 @@ static int find_max_timestamp_ctf_stream_class(
                struct ctf_file_stream **cfsp,
                uint64_t *max_timestamp)
 {
-       int ret = EOF, i;
+       int ret = EOF, i, found = 0;
 
        for (i = 0; i < stream_class->streams->len; i++) {
                struct ctf_stream_definition *stream;
@@ -272,9 +280,13 @@ static int find_max_timestamp_ctf_stream_class(
                if (current_max_ts >= *max_timestamp) {
                        *max_timestamp = current_max_ts;
                        *cfsp = cfs;
+                       found = 1;
                }
        }
        assert(ret >= 0 || ret == EOF);
+       if (found) {
+               return 0;
+       }
        return ret;
 }
 
This page took 0.023639 seconds and 4 git commands to generate.